UNPKG

@relayplane/sdk

Version:

RelayPlane SDK with zero-config AI access, intelligent model selection, built-in examples, and contextual error handling. The easiest way to add AI to your app with automatic optimization and fallback.

73 lines 1.92 kB
/** * Environment Detection Module * * Detects the current runtime environment and provides feature detection * for proper SDK behavior across different platforms. */ export interface EnvironmentInfo { isNode: boolean; isEdge: boolean; isBrowser: boolean; isServerless: boolean; isVercel: boolean; isNetlify: boolean; isAWS: boolean; isCloudflare: boolean; hasWebAPIs: boolean; hasFetch: boolean; hasWebStreams: boolean; hasAbortController: boolean; nodeVersion: string | null; platform: 'node' | 'edge' | 'browser' | 'serverless' | 'unknown'; runtime: string; supportsStreaming: boolean; maxTimeout: number; recommendedTimeout: number; } export declare const environment: EnvironmentInfo; /** * Get environment-specific configuration */ export declare function getEnvironmentConfig(): { preferFetch: boolean; supportStreaming: boolean; timeout: number; maxTimeout: number; requiresPolyfills: boolean; canUseNodeModules: boolean; optimizeForColdStart: boolean; }; /** * Check if current environment supports a specific feature */ export declare function supportsFeature(feature: string): boolean; /** * Get recommended SDK configuration for current environment */ export declare function getRecommendedConfig(): { timeout: number; debug: boolean; optimizeForColdStart: boolean; preferStreaming: boolean; errorRecovery: { maxRetries: number; retryDelay: number; }; http: { preferFetch: boolean; timeout: number; }; }; /** * Validate environment compatibility */ export declare function validateEnvironment(): { compatible: boolean; issues: string[]; recommendations: string[]; }; /** * Debug information for troubleshooting */ export declare function getDebugInfo(): Record<string, any>; //# sourceMappingURL=environment.d.ts.map