Overview
The Eusate Messenger SDK is an embeddable chat widget. Drop it into any website and your customers get a fully functional, AI-powered support chat — no backend code required on your end. It works as a floating button that opens a chat window. Everything inside (messages, calls, agent handover) is handled automatically.Script Tag
Paste one line into your HTML. Best for static sites, plain HTML, or any site where you just want to get started.
NPM Package
Install via npm or yarn. Best for React, Next.js, Vue, Angular, Svelte, or any modern framework.
Installation
Script Tag (Quickest)
Paste this into your HTML, just before</body>:
The
v0 path auto-updates with bug fixes and new features within the current major version. To pin to an exact release for maximum stability, use a full version path: https://cdn.eusate.com/messenger/v0.2.7/eusate-sdk.min.jsNode Packages
Quick Start
Plain HTML
React
Next.js (App Router)
The
'use client' directive is required — the SDK uses browser APIs (window, document) that are not available during server-side rendering.Vue 3
Configuration
Eusate.init(config)
string
required
Your API key. Get it from API Key Settings.
string
Target environment.
"production" (default) or "development". Use "development" while testing.() => void
Callback fired when the widget is loaded and ready to use.
(error: Error) => void
Callback fired if initialization fails (invalid API key, network issues, etc.).
Environment Variables
Methods
Eusate.open()
Programmatically open the chat window.
Eusate.close()
Programmatically close the chat window.
Eusate.destroy()
Remove the widget from the page entirely. Useful for cleanup in single-page apps when navigating away.
Eusate.isInitialized()
Returns true if the widget has loaded and is ready.
Eusate.isOpen()
Returns true if the chat window is currently visible.
Eusate.version
The current SDK version string.
Advanced Usage
Custom Trigger Button
Use your own button to open the chat instead of the default floating button:Conditional Loading
Only load the widget for certain users:Route Change Handling (SPAs)
Close the chat when navigating between pages:Security
Content Security Policy (CSP)
If your site enforces CSP headers, add these directives to allow the widget:Troubleshooting
Widget not appearing
- API key is correct and active in your dashboard
- No browser extensions (ad blockers) are intercepting the script
- JavaScript is enabled
Next.js: “window is not defined”
You’re importing the SDK in a server component. Add'use client' at the top of the file, or use dynamic import:
Widget appears more than once
You’re callinginit() multiple times. Use an empty dependency array in React:
More Frameworks
Next.js Pages Router
Angular
Svelte
Next Steps
- Socket.IO Events — build a fully custom chat UI from scratch
- REST API Reference — fetch conversations and messages via HTTP