UNPKG

@critters/next

Version:

Secure bug reporting library for Next.js applications

41 lines (40 loc) 1.15 kB
/** * Generate HMAC signature for request validation */ export declare function generateSignature(payload: string, secretKey: string | undefined): string; /** * Check if code is running in browser environment */ export declare function isBrowser(): boolean; /** * Check if code is running in server environment */ export declare function isServer(): boolean; /** * Get browser information */ export declare function getBrowserInfo(): Record<string, any>; /** * Format error object into a standardized structure */ export declare function formatError(error: Error | unknown): { name: string; message: string; stack?: string; }; /** * Safe stringify function that handles circular references */ export declare function safeStringify(obj: any): string; /** * Sanitize sensitive data from objects */ export declare function sanitizeData(data: Record<string, any>, sensitiveKeys?: string[]): Record<string, any>; /** * Get current timestamp in ISO format */ export declare function getTimestamp(): string; /** * Log message with prefix in debug mode */ export declare function debugLog(message: string, data?: any): void;