Skip to main content
Glama
use-token.ts514 B
import { useEffect, useState } from "react"; import { tokenRegistry } from "../lib/token-registry"; export function useToken(): string | null { const [token, setToken] = useState(null); useEffect(() => { if (tokenRegistry.hasToken()) { setToken(tokenRegistry.getToken()); return; } const unsubscribe = tokenRegistry.subscribe(() => { setToken(tokenRegistry.getToken()); }); return unsubscribe; }, []); return token; }

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/superglue-ai/superglue'

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