The Sunny Agents SDK is a TypeScript/JavaScript library that enables you to embed AI-powered chat experiences into any web application. Use createSunnyChat to drop in a fully-featured chat widget with automatic authentication and server-driven configuration.
The SDK is designed specifically for healthcare applications:
Help patients find in-network providers by specialty, location, and availability. Book appointments in seconds with AI-powered guidance.
Provide reliable health information and support 24/7. Answer questions about symptoms, medications, and care options.
Guide employees and members through their healthcare benefits. Help them understand coverage and find cost-effective care options.
Streamline care coordination by connecting patients with the right providers at the right time, reducing ER visits and improving outcomes.
Two authentication methods: custom token exchange and passwordless email/SMS. Automatic token management and refresh.
Pre-populate user profiles, addresses, insurance, and dependents during authentication. Supports static data and async providers.
Rich content delivered inline in messages via WebSocket. Parse embedded JSON for doctor profiles and structured data.
Conversations, messages, events, MCP approvals, file attachments, and state management.
REST and WebSocket API schemas and message types.
publicKey and partnerIdentifier are obtained from Sunny Central, the partner portal. Sign in at platform.sunnyhealthai.com (production) or platform.sunnyhealthai-staging.com (staging), then go to Developer Tools to create API keys, view your partner name, and configure authentication (allowed domains and token exchange). See Partner Setup for details.
createSunnyChat fetches your partner’s auth configuration from the server via the /sdk/config endpoint, activates the chosen authentication mode, and renders a chat widget in your container. The WebSocket connection is established when the user sends their first message.
Provide your partner identifier, public key, and auth type — all authentication configuration is handled automatically by the server:
The SDK supports two authentication methods. You specify the authType and the SDK handles everything else using server-provided configuration:
For applications with their own authentication (Auth0, Firebase, custom providers):
Email or SMS-based authentication without passwords. The SDK renders a verification UI in the chat automatically:
The SDK is framework-agnostic and works with:
createSunnyChat in a useEffect hookonMounted lifecycleGet up and running in minutes
REST and WebSocket API schemas
Authentication modes and setup
Learn core concepts and patterns
Need help? Check out our Quickstart guide to get started, or browse the API Reference for token exchange and message schemas.