Guides
Web widget
Customize the embeddable JS widget — branding, identification, and events.
The web widget is a small JS bundle (~30 kB gzip) that mounts a chat bubble in the bottom corner of any page.
Loading
<script src="https://cs.askais.com/widget.js"
data-app-id="YOUR_APP_ID"
data-base-url="https://cs.askais.com"></script>⚠️ Always load it from cs.askais.com — do not copy or self-host widget.js. Loaded from the official URL the widget updates itself automatically. If you download the file or compile it into your own bundle, you freeze it at one version and miss every future update. See Integration overview.
Identifying logged-in users
For anonymous visitors, the widget auto-generates a contact. For logged-in users, callSingChat.identify() with your user info:
window.SingChat.identify({
externalId: "user_123",
name: "Ada Lovelace",
email: "ada@example.com",
customAttributes: { plan: "pro", signupAt: "2025-01-12" },
});Programmatic open / close
SingChat.open();
SingChat.close();
SingChat.toggle();Listening to events
SingChat.on("message:new", (msg) => {
console.log("new message", msg);
});
SingChat.on("ai:stream:end", ({ messageId }) => {
// AI finished streaming
});Theming
In Settings → Inboxesyou can configure the widget's primary color, position, and greeting text. White-label (hide "Powered by AskAIs Customer Service") is on Pro and above.
Security
- The
app-idis public — fine to ship in HTML - The secret key is server-side only — never expose in browser code
- For high-trust use cases, sign user payloads server-side with the secret key (HMAC-SHA256) — see API authentication