Skip to main content
Glama
useIntlayerAPI.ts1.04 kB
import { type FetcherOptions, getIntlayerAPI, type IntlayerAPI, } from '@intlayer/api'; import { useConfiguration } from '@intlayer/editor-react'; import type { IntlayerConfig } from '@intlayer/types'; import { type AuthAPI, getAuthAPI } from '../libs/auth'; import { useAuth } from './useAuth'; type UseIntlayerAuthProps = { options?: FetcherOptions; intlayerConfiguration?: IntlayerConfig; }; export const useIntlayerOAuth = (props?: UseIntlayerAuthProps): IntlayerAPI => { const configuration = useConfiguration(); const { oAuth2AccessToken } = useAuth(); return getIntlayerAPI( { ...(oAuth2AccessToken && { headers: { Authorization: `Bearer ${oAuth2AccessToken.accessToken}`, }, }), ...(props?.options ?? {}), }, props?.intlayerConfiguration ?? configuration ); }; export const useIntlayerAuth = (props?: UseIntlayerAuthProps): AuthAPI => { const configuration = useConfiguration(); return getAuthAPI(props?.intlayerConfiguration ?? configuration); };

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