light-sentry-sdk/dist/utils/identity.d.ts

22 lines
571 B
TypeScript
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/**
* 获取匿名用户ID
* 优先从 localStorage 获取已存在的ID不存在则生成并存储
*/
export declare function getAnonymousId(): string | null;
/**
* 设置匿名用户ID
* 用于覆盖自动生成的ID
*/
export declare function setAnonymousId(id: string): boolean;
/**
* 清除匿名用户ID
* 通常在用户登出后调用
*/
export declare function clearAnonymousId(): boolean;
/**
* 检查是否启用了匿名用户追踪
*/
export declare function isAnonymousTrackingEnabled(config: {
trackAnonymousUsers?: boolean;
}): boolean;