UNPKG

@tracetail/vue

Version:

Vue SDK for TraceTail browser fingerprinting - over 99.5% accuracy

71 lines (70 loc) 1.65 kB
import { Ref } from 'vue'; export interface Fingerprint { visitorId: string; confidence: number; riskScore: number; fraudulent: boolean; signals: SignalData; timestamp: Date; } export interface SignalData { browser: string; os: string; device: string; screen: { width: number; height: number; colorDepth: number; }; timezone: string; language: string; plugins: string[]; fonts: string[]; canvas: string; webgl: string; audio: string; vpn: boolean; tor: boolean; proxy: boolean; } export interface TrackingResult { success: boolean; fraudulent: boolean; riskScore: number; eventId: string; } export interface FraudResult { block: boolean; challenge: boolean; allow: boolean; riskScore: number; reasons: string[]; } export interface TraceTailConfig { apiKey: string; enhanced?: boolean; timeout?: number; endpoint?: string; testMode?: boolean; mockData?: Partial<Fingerprint>; } export interface TraceTailOptions { apiKey: string; config?: Omit<TraceTailConfig, 'apiKey'>; } export interface FingerprintComposable { visitorId: Ref<string | null>; confidence: Ref<number>; riskScore: Ref<number>; fraudulent: Ref<boolean>; signals: Ref<SignalData | null>; loading: Ref<boolean>; error: Ref<Error | null>; retry: () => Promise<void>; refresh: () => Promise<void>; } export interface FraudDetectionComposable { checkFraud: (data: any) => Promise<FraudResult>; fraudSignals: Ref<Partial<SignalData>>; isChecking: Ref<boolean>; }