February 10, 2026

Breaking changes

Server-driven auth configuration for createSunnyChat

The createSunnyChat API now uses server-driven authentication configuration. Instead of passing Auth0 details (domain, clientId, connection) directly, you provide three required parameters and the server supplies all auth configuration automatically via the HTTP GET /sdk/config endpoint.

Before (v0.0.11):

1const chat = createSunnyChat({
2 container: document.getElementById("chat"),
3 auth: {
4 type: "saml",
5 domain: "your-tenant.auth0.com",
6 clientId: "your-client-id",
7 connection: "guardian-saml",
8 audience: "https://api.sunnyhealthai-staging.com",
9 },
10});

After (v0.0.14):

1const chat = createSunnyChat({
2 container: document.getElementById("chat"),
3 partnerIdentifier: "acme-health",
4 publicKey: "pk-sunnyagents_abc_xyz",
5 authType: "saml",
6});

Migration:

  • Replace auth.type with top-level authType
  • Add partnerIdentifier and publicKey (provided by Sunny Health)
  • Remove all Auth0 configuration fields (domain, clientId, connection, audience, organization) — these are now provided by the server
  • For tokenExchange, move idTokenProvider to a top-level option
  • The auth object is no longer accepted

Removed types

The following types have been removed:

  • AuthConfig
  • SamlOidcAuthConfig
  • TokenExchangeAuthConfig

Replaced by:

  • UnifiedSunnyChatOptions — configuration for createSunnyChat
  • SdkAuthType'passwordless' | 'saml' | 'oidc' | 'tokenExchange'
  • SdkAuthConfig — server-provided auth configuration (read-only)

New features

Runtime auth type switching

createSunnyChat now returns a VanillaChatInstance with a setAuthType method for switching authentication types at runtime:

1const chat = createSunnyChat({ /* ... */ });
2await chat.setAuthType("saml");
3await chat.setAuthType("tokenExchange", {
4 idTokenProvider: async () => getMyToken(),
5});

Token exchange organization field

The tokenExchange configuration now includes a required organization field for Auth0 organization support.

Enhancements

  • Default WebSocket URL is wss://chat.api.sunnyhealthai-staging.com (no need to specify explicitly)
  • SunnyAgentsClient can be instantiated with no arguments for quick setup
  • sendMessage now returns { conversationId: string } for tracking
  • createConversation now accepts an optional conversationId parameter