Choose Your Integration
JavaScript SDK
Server-side and client-side SDK for Node.js, browsers, and TypeScript. Full API access with streaming support.
Widget API
Control the chat widget programmatically — open, close, send messages, and listen to events.
Forms & Triggers
Trigger forms programmatically and handle submissions with custom callbacks.
User Identity
Pass user context to personalize conversations and pre-fill forms with known data.
Custom Events
Track user actions and trigger automations based on custom events.
Webhooks
Receive real-time notifications when conversations happen or forms are submitted.
Quick Start
Option 1: Embed Script (Recommended)
The simplest way to add Ansa to your site. Add this script before the closing</body> tag:
ansa object is automatically available on window for programmatic control:
Waiting for Widget Ready
The widget loads asynchronously. To ensure the widget is ready before calling methods:Option 2: JavaScript SDK
For server-side integrations or custom chat interfaces, install the SDK:API Overview
Widget API Methods
Theansa object exposes these methods when using the embed script:
SDK Methods
TheAnsaClient provides full API access:
Architecture
postMessage, and the widget communicates with the Ansa API. Webhooks notify your server of events in real-time.
Next Steps
SDK Reference
Complete SDK documentation with TypeScript types
Widget Customization
Customize the widget appearance and behavior