UNPKG

react-waitlist

Version:

A customizable waitlist form component for React applications

31 lines (30 loc) 1.05 kB
import { WaitlistEventType, WaitlistEventData } from './events'; import { WebhookConfig } from './types'; /** * Payload for webhook requests */ export interface WebhookPayload { /** Event that triggered the webhook */ event: WaitlistEventType; /** Timestamp of the event */ timestamp: string; /** Field name (for field_focus events) */ field?: string; /** Form data */ formData?: Record<string, any>; /** Response from API (for success events) */ response?: any; /** Error information (for error events) */ error?: { message: string; code?: string; }; } /** * Send a webhook request */ export declare const sendWebhook: (config: WebhookConfig, eventData: WaitlistEventData, webhookProxyEndpoint?: string) => Promise<Response | null>; /** * Send webhooks to configured endpoints */ export declare const sendWebhooks: (webhooks: WebhookConfig[] | undefined, eventType: string, formData: Record<string, any>, response?: any, error?: Error, proxyEndpoint?: string) => Promise<void>;