import type { IEnv } from '../../types'; import type { IUserIdentity } from './types'; /** * Hash an API key with SHA-256 for use as a Sentry-safe identity token. * * Only the hash is ever returned. The most recently hashed key and its hash * are cached in memory, so a repeat call skips the digest and a different key * replaces the cache instead of returning the previous key's hash. * * When the runtime has no usable `crypto.createHash` (e.g. a browser bundle * without a `crypto` shim) this returns `''` rather than throwing, so the * Sentry identity falls back to the next identifier instead of being dropped. * * @param apiKey - The raw API key to hash * @returns Hex-encoded SHA-256 hash of `apiKey`, or `''` for an empty input or * when hashing is unavailable */ export declare function hashApiKey(apiKey: string): string; /** * Generate a session ID that persists for the SDK instance lifetime. * Provides user continuity even when wallet is not connected. * * @returns UUID v4 session identifier */ export declare function getSessionId(): string; /** * Generate a browser/environment fingerprint for cross-session tracking. * Falls back gracefully in different environments. * * @returns Base64 encoded fingerprint string or undefined if unavailable */ export declare function generateFingerprint(): string | undefined; /** * Create a composite user identity for analytics. * * @param apiKey - Optional API key (will be hashed, never stored raw) * @param walletAddress - Optional wallet address * @param environment - Current environment (DEV or PROD) * @returns User identity object */ export declare function createUserIdentity(apiKey?: string, walletAddress?: string, environment?: IEnv): IUserIdentity; /** * Generate a unique user ID for Sentry from identity components. * Priority: apiKeyHash \> wallet \> domain \> fingerprint \> session * * An API key identifies the integrator and a wallet identifies the end user, * so both outrank the hosting domain — otherwise every visitor of one web app * collapses into a single Sentry user. `domain` still ranks above the * fingerprint, which nearly every runtime produces, so hostname attribution * is not lost. * * @param identity - User identity object * @returns Prefixed user ID string */ export declare function getUserId(identity: IUserIdentity): string;