Skip to main content
Glama
fetchDistantDictionaries.ts924 B
import type { IntlayerConfig } from '@intlayer/types'; import { getIntlayerAPIProxy } from '../proxy'; import type { DictionaryAPI } from '../types'; /** * Fetch distant dictionary */ export const fetchDistantDictionaries = async ( intlayerConfig: IntlayerConfig ): Promise<DictionaryAPI[] | null | undefined> => { try { const { clientId, clientSecret } = intlayerConfig.editor; if (!clientId || !clientSecret) { throw new Error( 'Missing OAuth2 client ID or client secret. To get access token go to https://intlayer.org/dashboard/project.' ); } const api = getIntlayerAPIProxy(undefined, intlayerConfig); // Fetch the dictionary list const getDictionaryResult = await api.dictionary.getDictionaries(); const distantDictionaries = getDictionaryResult.data; return distantDictionaries; } catch (error) { console.error(error); return undefined; } };

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