Skip to main content
The chat widget puts an agent on any web page. It’s one script tag, configured with data attributes, and a small JavaScript API on window.easyPeasyChat for opening, hiding, and identifying the visitor. To get the snippet without code, see Add your agent to your website.

Embed

Load it as a classic <script> tag, not a module. Your agent ID is under Channels > Website > Your Agent ID.

JavaScript API

The script creates window.easyPeasyChat. You can call its methods before the widget has loaded; the calls wait and run once it’s ready. When the widget is ready, the window also receives a DOM event, easy-peasy-chat:ready.

Start hidden

To load the widget without showing the bubble, for example on a checkout page, set this before the script tag and call show() when you want it:

Single-page apps

Load the script once, in your root layout, and call hide() and show() on route changes. The widget tells the agent about each client-side navigation, so Conversations shows the page each chat started on and the last page the visitor saw.

Identify the visitor

If visitors sign in to your website, pass their details so their conversations show who they are in Conversations:
Call setContact(null) when the visitor signs out. You can also set it before the script loads:
These details label conversations; they aren’t verified. Anyone who can run code on your page can set them, so don’t use them to decide what the agent may share.

Iframe

To place the chat inside a page instead of floating over it:
allow="microphone" lets visitors use voice input and voice calls.

Allowed domains and Content Security Policy

If the agent has Allowed Domains set, the widget works only on those domains. If your site sends a Content Security Policy, allow https://bots.easy-peasy.ai in script-src, frame-src, and connect-src.

Add your agent to your website

Build the snippet in the dashboard.

Agents API

Talk to your agent from your backend.