// Type definitions for @vocantly/widget export interface VocantlyWidgetOptions { /** Realtime WebSocket URL, e.g. "wss://ws.vocantly.com/ws". */ wsUrl: string; // Provisioning — supply EITHER (token + conversationId) OR publicKey. /** SDK token for this visitor (minted by your backend via POST /apps/:id/support-sessions). */ token?: string; /** Support conversation id (returned alongside the token). */ conversationId?: string; /** * App PUBLIC key (pk_…). Anonymous mode: the widget self-provisions a session via * POST /sdk/anonymous-session — no backend needed. Requires `apiUrl`, and your site's origin * must be in the app's allowed_origins. */ publicKey?: string; /** Backend REST base, e.g. "https://api.vocantly.com/api/v1". Required for publicKey mode; enables history + contact capture. */ apiUrl?: string; title?: string; subtitle?: string; /** Local greeting bubble shown when the panel opens. */ greeting?: string; placeholder?: string; /** Accent color (hex). Default "#195EFF". */ primaryColor?: string; position?: 'bottom-right' | 'bottom-left'; /** Launcher glyph/emoji. Default "💬". */ launcher?: string; /** Open the panel automatically on init. */ autoOpen?: boolean; debug?: boolean; /** Ask the visitor for name + email before chatting (saved via PATCH /sdk/customers/me). Needs apiUrl. */ collectContact?: boolean; /** When collectContact is on, require an email to start. */ requireEmail?: boolean; contactPrompt?: string; /** * Ask the visitor to rate the support (1–5) once an agent closes the conversation. * Defaults to true. Needs apiUrl. */ csat?: boolean; csatPrompt?: string; csatThanks?: string; /** Show the native “Raise a ticket” action. Defaults to true in public-key mode. */ tickets?: boolean; ticketLabel?: string; } export interface VocantlyWidgetInstance { open(): void; close(): void; send(text: string): void; destroy(): void; } /** Mount + connect the widget. Returns a handle to control it. */ export function init(opts: VocantlyWidgetOptions): VocantlyWidgetInstance; /** Open the panel (no-op if not initialised). */ export function open(): void; /** Close the panel. */ export function close(): void; /** Disconnect and remove the widget from the DOM. */ export function destroy(): void; declare const _default: { init: typeof init; open: typeof open; close: typeof close; destroy: typeof destroy; }; export default _default;