There are two ways to put raia Chat on a page. The JavaScript SDK (window.raiaChat) gives you full programmatic control over when the widget loads, who the user is, and what happens on each event. The iframe is a one-line drop-in for static sites and CMS pages where you cannot run custom scripts.
In this section
- Choose between the SDK and the iframe for a given surface.
- Install the SDK snippet and open, close, and control the widget from your own code.
- Pass authenticated user context securely with a signed token instead of query strings.
- Handle widget events to fire analytics and to react to escalations.
What's inside
- 01
Script embed (SDK)
Add the snippet from Launch Pad → Launch just before the closing body tag. It loads asynchronously and exposes window.raiaChat once ready. Best for SPAs, authenticated apps, and anywhere you need control.
- 02
Iframe embed
Drop the iframe URL into any page or CMS block. No JavaScript API, no user context — the widget renders inside the frame with the settings from Live Chat Configuration.
- 03
User context
For authenticated experiences, sign the user identity server-side and hand the token to the SDK. Never trust identity passed from the browser alone.
- 04
Events
Subscribe to lifecycle events — widget opened, conversation started, message sent, escalation raised, conversation ended — and forward them to your analytics stack.
At a glance
| Capability | SDK | Iframe |
|---|---|---|
| Programmatic open/close | Yes — raiaChat.open() / .close() | No |
| Authenticated user context | Yes, via signed token | No |
| Event callbacks | Yes | No |
| Prefill or send a message | Yes | No |
| Route-aware behavior in an SPA | Yes | No |
| Setup effort | One snippet plus optional wiring | One line of HTML |
Security
Both methods enforce the allowed origin list and the Security Key configured on the widget. Keep secret keys server-side — only the public key belongs in browser code.