Skip to main content
Glama

Storyden

by Southclaws
Mozilla Public License 2.0
227
useAccessKeySettings.ts948 B
"use client"; import { useSWRConfig } from "swr"; import { handle } from "@/api/client"; import { accessKeyDelete, getAccessKeyListKey, } from "@/api/openapi-client/auth"; import { AccessKeyList, Identifier } from "@/api/openapi-schema"; export function useAccessKeySettings() { const { mutate } = useSWRConfig(); const revokeKey = async (keyId: Identifier) => { await handle(async () => { const cacheKey = getAccessKeyListKey(); await mutate( cacheKey, async (currentData: { keys: AccessKeyList } | undefined) => { if (!currentData) return currentData; const updatedKeys = currentData.keys.map((key) => key.id === keyId ? { ...key, enabled: false } : key, ); return { ...currentData, keys: updatedKeys }; }, false, ); await accessKeyDelete(keyId); await mutate(cacheKey); }); }; return { revokeKey }; }

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/Southclaws/storyden'

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