Configuration
All options are passed to PeriscaleChat.init({ ... }).
js
PeriscaleChat.init({
apiKey: "sb_live_xxx",
position: "bottom-right",
primaryColor: "#20808D",
agentName: "Support",
greeting: "Hi! How can we help?",
});Required
| Option | Type | Description |
|---|---|---|
apiKey | string | Your sb_live_* business key. The widget will not render without it. |
Appearance
| Option | Type | Default | Description |
|---|---|---|---|
position | string | "bottom-right" | "bottom-right" or "bottom-left". |
primaryColor | string | "#20808D" | Brand color for the bubble and panel header. |
textColor | string | "#ffffff" | Text color used on top of primaryColor. |
bubbleSize | number | 60 | Floating button size in pixels. |
borderRadius | number | 16 | Panel corner radius in pixels. |
fontFamily | string | system stack | Override the panel font. |
Content
| Option | Type | Description |
|---|---|---|
greeting | string | Welcome message shown when the panel opens. |
placeholder | string | Message composer placeholder. |
agentName | string | Display name in the panel header. |
agentAvatar | string | URL of the agent avatar image. |
Pre-chat form
| Option | Type | Description |
|---|---|---|
formTitle | string | Heading shown above the pre-chat form. |
nameLabel | string | Label for the name field. |
emailLabel | string | Label for the email field. |
phoneLabel | string | Label for the phone field. |
Channels
| Option | Type | Default | Description |
|---|---|---|---|
chatEnabled | boolean | true | Hide the chat bubble entirely. |
voiceCallEnabled | boolean | false | Show a voice-call button. Requires ttsUrl. |
ttsUrl | string | — | TTS service endpoint for voice calls. |
whatsappEnabled | boolean | false | Show a floating WhatsApp button. |
whatsappNumber | string | — | WhatsApp number with country code, e.g. 8801712345678. |
Page-aware mode
When pageAwareEnabled: true, the widget sends the page's title, headings, Open Graph metadata, and JSON-LD to the agent on each open — useful for product-detail pages where the agent should know what the visitor is looking at.
| Option | Type | Default | Description |
|---|---|---|---|
pageAwareEnabled | boolean | false | Send page context to the agent on open. |
ES module usage
If you use a bundler:
js
import { PeriscaleChat } from "@periscale/chat-widget";
PeriscaleChat.init({ apiKey: "sb_live_xxx" });The ES build is at https://cdn.periscale.app/chat-widget.es.js.