Skip to main content
Glama
getServerIntlayerAPI.ts657 B
import { getIntlayerAPI, type IntlayerAPI } from '@intlayer/api'; import { headers } from 'next/headers'; /** * This function is useful as cookies are not directly available in the server context (Page / Layout) * So we need to get the cookies from the headers and build the API client with the cookies */ export const getServerIntlayerAPI = async (): Promise<IntlayerAPI> => { const headersList = await headers(); const cookie = headersList.get('cookie'); // Build API client with incoming request cookies so backend uses the user session const api = getIntlayerAPI({ headers: { cookie, } as HeadersInit, }); return api; };

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/aymericzip/intlayer'

If you have feedback or need assistance with the MCP directory API, please join our Discord server