UNPKG

@dodgeball/trust-sdk-client

Version:
34 lines (33 loc) 1.08 kB
import { IIdentifierIntegration, IFingerprint } from "./types"; export interface IIdentifierProps { cookiesEnabled: boolean; apiUrl: string; apiVersion: string; publicKey: string; clientUrl?: string; } export default class Identifier { publicKey: string; apiUrl: string; apiVersion: string; cookieName: string; cookiesEnabled: boolean; constructor({ cookiesEnabled, apiUrl, apiVersion, publicKey, clientUrl, }: IIdentifierProps); getSource(): { token: string; expiry: number; } | null; saveSource(newSource: { token: string; expiry: number; } | null): void; gatherFingerprints(identifiers: IIdentifierIntegration[]): Promise<IFingerprint[]>; generateSourceToken(identifiers: IIdentifierIntegration[]): Promise<{ token: string; expiry: number; }>; expireSourceToken(): Promise<void>; saveSourceTokenMetadata(sourceToken: string, identifiers: IIdentifierIntegration[]): Promise<{ [key: string]: any; }>; }