import type { OnairosConfig, ApiKeyValidationResult, ValidatedApplicationContext } from '../types'; export declare enum ApiKeyType { DEVELOPER = "developer", INVALID = "invalid" } /** * Initialize the SDK with developer API key * @param config API configuration including developer API key */ export declare const initializeApiKey: (config: OnairosConfig) => Promise; /** * Determine API key type * @param apiKey The API key to check * @returns The type of API key (only DEVELOPER or INVALID - admin keys not supported in client SDK) */ export declare const getApiKeyType: (apiKey: string) => ApiKeyType; /** * Validate an API key with the Onairos backend * All developer keys must be validated against the backend - no local bypass * @param apiKey The API key to validate * @returns Validation result with permissions and rate limits */ export declare const validateApiKey: (apiKey: string) => Promise; /** * Get the current API configuration * @returns Current API configuration or null if not initialized */ export declare const getApiConfig: () => OnairosConfig | null; /** * Get the validated application context returned by /dev/validate-apikey. */ export declare const getValidatedApplication: () => ValidatedApplicationContext | null; /** * Check whether the initialized SDK key belongs to the Onairos first-party main app. */ export declare const isOnairosMainApp: () => boolean; /** * Get the current API key * @returns Current API key or null if not initialized */ export declare const getApiKey: () => string | null; /** * Check if the SDK is properly initialized * @returns True if initialized with valid API key */ export declare const isApiKeyInitialized: () => boolean; /** * Store JWT token securely after email verification * @param token JWT token from email verification response */ export declare const storeJWT: (token: string) => Promise; /** * Load JWT token from storage * @returns JWT token or null if not found */ export declare const loadJWT: () => Promise; /** * Get current JWT token * @returns JWT token or null if not available */ export declare const getJWT: () => string | null; /** * Clear JWT token (on logout or token expiration) */ export declare const clearJWT: () => Promise; /** * Decode JWT token payload (React Native compatible) * @param token JWT token string * @returns Decoded payload or null if invalid */ export declare const decodeJWTPayload: (token: string) => any; /** * Extract username from JWT token * @param token JWT token (optional, uses stored token if not provided) * @returns Username or null if not found */ export declare const extractUsernameFromJWT: (token?: string) => string | null; /** * Extract user data from JWT token * @param token JWT token (optional, uses stored token if not provided) * @returns User data object or null if not found */ export declare const extractUserDataFromJWT: (token?: string) => any; /** * Check if user is authenticated with JWT token * @returns True if user has valid JWT token */ export declare const isUserAuthenticated: () => boolean; /** * Get authenticated headers for API requests * @returns Headers object with Authorization and other required headers */ export declare const getAuthHeaders: () => Record; /** * Get authentication headers for developer API requests * @returns Headers with developer API key */ export declare const getDeveloperAuthHeaders: () => Record; /** * Get authentication headers for user JWT requests * @returns Headers with user JWT token */ export declare const getUserAuthHeaders: () => Record; /** * Make an authenticated API request * @param endpoint The API endpoint (relative to base URL) * @param options Fetch options * @returns Response promise */ export declare const makeAuthenticatedRequest: (endpoint: string, options?: RequestInit) => Promise; /** * Make authenticated request with developer API key * @param endpoint The API endpoint * @param options Fetch options * @returns Response promise */ export declare const makeDeveloperRequest: (endpoint: string, options?: RequestInit) => Promise; /** * Make authenticated request with user JWT token * @param endpoint The API endpoint * @param options Fetch options * @returns Response promise */ export declare const makeUserRequest: (endpoint: string, options?: RequestInit) => Promise; /** * Clear the API key validation cache */ export declare const clearValidationCache: () => void; /** * Reset the SDK initialization state */ export declare const resetApiKeyService: () => void; //# sourceMappingURL=apiKeyService.d.ts.map