UNPKG

@softlock/sdk

Version:

Official Softlock SDK for access key validation and management

52 lines 1.44 kB
/** * Configuration for the Softlock client */ export interface SoftlockConfig { /** Your Softlock project/tenant ID */ tenantId: string; /** Base URL for your Softlock instance (defaults to official hosted service) */ baseUrl?: string; /** API key for server-side validation (optional for client-side) */ apiKey?: string; /** Cache TTL in milliseconds (default: 5 minutes) */ cacheTtl?: number; /** Enable debug logging */ debug?: boolean; } /** * Core Softlock client for access key validation */ export declare class SoftlockClient { private config; private cache; constructor(config: SoftlockConfig); /** * Validate an access key */ validateKey(keyValue: string): Promise<any>; /** * Clear validation cache */ clearCache(): void; /** * Update configuration */ updateConfig(newConfig: Partial<SoftlockConfig>): void; /** * Get current configuration (without sensitive data) */ getConfig(): Omit<SoftlockConfig, 'apiKey'>; } /** * Initialize the default Softlock client */ export declare function initSoftlock(config: SoftlockConfig): SoftlockClient; /** * Get the default client instance */ export declare function getSoftlockClient(): SoftlockClient; /** * Validate a key using the default client */ export declare function validateKey(keyValue: string): Promise<any>; //# sourceMappingURL=core.d.ts.map