@dodgeball/trust-sdk-client
Version:
Dodgeball Client SDK
53 lines (52 loc) • 2.12 kB
TypeScript
import { IDodgeballConfig, IHandleVerificationOptions, IInitConfig, IVerification, IVerificationContext } from "./types";
export declare class Dodgeball {
private publicKey;
private config;
private identifier;
private seenSteps;
private integrationLoader;
private integrations;
private areIntegrationsLoaded;
private onIntegrationsLoaded;
private isSourcing;
private onSource;
private sourceToken;
private sourceTokenExpiry;
private refreshSourceTokenHandle;
private sessionHelperIsLoaded;
private sessionHelperIframe;
private onSessionHelper;
private useSessionFallback;
constructor(publicKey: string, config?: IDodgeballConfig);
private isSourceTokenValid;
private registerSourceTokenRefresh;
private sendSessionUtilMessage;
private generateSourceToken;
private filterSeenSteps;
private handleVerificationStep;
private verifyTimeDelta;
private handleVerificationOutcome;
private clearScreen;
track(sessionId: string, userId?: string): void;
private attachIdentifierMetadata;
getSourceToken(onSource?: Function): Promise<string>;
refreshSourceToken(onSource?: Function): Promise<string>;
handleVerification(verification: IVerification, context: IVerificationContext, options?: IHandleVerificationOptions): void;
isRunning(verification: IVerification): boolean;
isAllowed(verification: IVerification): boolean;
isDenied(verification: IVerification): boolean;
isUndecided(verification: IVerification): boolean;
isCancelled(verification: IVerification): boolean;
hasError(verification: IVerification): boolean;
getSession(onSession?: Function): Promise<string | null>;
setSession(sessionId: string, expiry?: number): void;
clearSession(): void;
}
export declare function useDodgeball(publicKey?: string, config?: IDodgeballConfig): Dodgeball;
declare global {
interface Window {
Dodgeball: typeof Dodgeball;
dodgeball: Dodgeball;
_dodgeball_init_conf: IInitConfig;
}
}