UNPKG

twenty-mcp-server

Version:

Easy-to-install Model Context Protocol server for Twenty CRM. Try instantly with 'npx twenty-mcp-server setup' or install globally for permanent use.

47 lines 1.36 kB
export interface StoredApiKey { twentyApiKey: string; twentyBaseUrl?: string; twentyApiKeyUpdatedAt: string; } /** * Service for securely storing and retrieving user API keys * Uses Clerk's privateMetadata with encryption */ export declare class KeyStorageService { private clerkClient; private encryptionService; constructor(); /** * Store an encrypted API key for a user */ storeApiKey(userId: string, apiKey: string, baseUrl?: string): Promise<void>; /** * Retrieve and decrypt a user's API key */ getApiKey(userId: string): Promise<StoredApiKey | null>; /** * Delete a user's API key */ deleteApiKey(userId: string): Promise<void>; /** * Validate if a stored API key matches a given key */ validateApiKey(userId: string, apiKey: string): Promise<boolean>; /** * Rotate a user's API key */ rotateApiKey(userId: string, newApiKey: string, baseUrl?: string): Promise<void>; /** * Get API key metadata without decrypting */ getApiKeyMetadata(userId: string): Promise<{ hasKey: boolean; updatedAt?: string; baseUrl?: string; }>; } /** * Get or create the key storage service instance */ export declare function getKeyStorageService(): KeyStorageService; //# sourceMappingURL=key-storage.d.ts.map