@klevu/core
Version:
Typescript SDK that simplifies development on Klevu backend. Klevu provides advanced AI-powered search and discovery solutions for online retailers.
29 lines (28 loc) • 937 B
TypeScript
type SegmentInfo = {
segments: string[];
ttl: number;
};
type SessionApiResponse = {
apikey: string;
sessionId: string;
segmentInfo: SegmentInfo;
};
export declare const USER_SESSION_ID_STORAGE_KEY = "klevu-user-sessionId";
export declare const USER_SESSION_EXPIRY_STORAGE_KEY = "klevu-user-session_expiry";
export declare const USER_SEGMENT_INFO_STORAGE_KEY = "klevu-user-segmentInfo";
export declare class KlevuUserSession {
timer: null | ReturnType<typeof setTimeout>;
static default: KlevuUserSession | undefined;
expiry?: string | null;
segmentInfo?: SegmentInfo | null;
sessionId?: string | null;
constructor();
static init(): void;
static getDefault(): KlevuUserSession;
hasSessionExpired(): boolean;
generateSession(): Promise<void>;
setExpiryTimer(): void;
getSessionId: () => Promise<SessionApiResponse | undefined>;
getSegments(): string[];
}
export {};