Types & Interfaces
The Spidify SDK is written in TypeScript and provides robust type definitions.
SpidifyOptions
export interface SpidifyOptions {
container: string | HTMLElement;
apiKey: string;
productUrl: string;
userId: string;
redirectUrl?: string;
webhookUrl?: string;
referencePhotoUrl?: string;
copilotSessionId?: string;
branding?: {
primaryColor?: string;
secondaryColor?: string;
};
onStep?: (event: SpidifyHandshakeEvent) => void;
onSuccess?: (data: any) => void;
onFailure?: (error: string) => void;
}
SpidifyHandshakeEvent
export interface SpidifyHandshakeEvent {
step: SpidifyStep;
status: 'start' | 'end';
timestamp?: string;
metadata?: Record<string, any>;
}
SpidifyStep
export type SpidifyStep =
| "consent"
| "otp-verification"
| "contact-information"
| "identity-validation"
| "address-verification"
| "compliance-check"
| "liveness-detection";
KycConfig
export interface KycConfig {
apiKey: string;
baseUrl: string;
externalApiUrl?: string;
containerId?: string;
}