Skip to main content
Glama
ConfigurationContext.tsx965 B
'use client'; import { MessageKey } from '@intlayer/editor'; import type { IntlayerConfig } from '@intlayer/types'; import { createContext, type FC, type PropsWithChildren, useContext, } from 'react'; import { useCrossFrameState } from './useCrossFrameState'; const ConfigurationStatesContext = createContext<IntlayerConfig | undefined>( undefined ); export const useConfigurationState = () => useCrossFrameState<IntlayerConfig>( MessageKey.INTLAYER_CONFIGURATION, undefined, { receive: false, emit: true, } ); export type ConfigurationProviderProps = { configuration?: IntlayerConfig; }; export const ConfigurationProvider: FC< PropsWithChildren<ConfigurationProviderProps> > = ({ children, configuration }) => ( <ConfigurationStatesContext.Provider value={configuration}> {children} </ConfigurationStatesContext.Provider> ); export const useConfiguration = () => useContext(ConfigurationStatesContext);

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