Enable the widget
Turn on the widget for a bot and paste the embed code into your website.
The widget lets visitors chat with your bot on your website without a Pegasus account. Paste one snippet into your site and a chat button appears in the bottom-right corner.
What visitors and owners should expect
When a visitor opens the widget, it greets them with your greeting (by default "Hi! How can I help you today?") and Pegasus creates an anonymous visitor session. Visitors do not sign in. The bot owner sees widget traffic in the usage figures, but not the full widget chat history. Visitors can rate answers, and the owner reads those ratings in the bot's Feedback tab. See Answer feedback.
If a visitor's message cannot be sent, the widget keeps the message and shows "Message not sent." with a Retry button.
The bot owner manages:
| Item | Where |
|---|---|
| Turn the widget on or off | Bot detail -> Embed tab |
| Copy the embed code | Bot detail -> Embed tab |
| View or rotate the widget token | Bot detail -> Embed tab |
| Allowed websites | Bot detail -> Embed tab |
| Colors, greeting and input hint | Bot detail -> Embed tab |
| Remove the widget | Bot detail -> Embed tab |
| Whether the bot is Ready | Training sources tab |
The widget is available on Free, Pro, and Ultra plans.
Visitors only see a working widget
The widget appears on your site only when it can chat. If the bot is not Ready, the widget is turned off or removed, the token is wrong, or the website is not in Allowed websites, visitors do not see the chat button. Instead, the browser console on your page shows a warning from the widget. See Widget troubleshooting.
Enable the widget
Open the bot's Embed tab
On the bot detail page, open the Embed tab. The side column lists the setup steps under How it works.
Click Turn on widget
Pegasus creates the widget and its widget token. The switch now reads Widget is on.
Copy the embed code
The Embed code section shows the snippet. Click Copy snippet.
Paste it into your website
Put the snippet inside
<body>on any page where you want the chat button. Most sites add it once in a shared layout or template.Reload the page
When the bot is Ready, the chat button appears in the bottom-right corner. Click it to test.
If the widget does not turn on, Pegasus shows "Failed to enable the embed widget." Try again.
What the snippet contains
The snippet is a <script> tag that loads the Pegasus widget, along with the widget token. No other secret is exposed.
The token is public on purpose: the widget uses it to know which bot to load. Protection comes from Allowed websites, not from hiding the token in page source.
Turn the widget off or on
Use the switch in the Website widget section of the Embed tab. It reads Widget is on or Widget is off. When it is off, visitors cannot start new chats and the chat button is hidden, but the widget token and embed code are kept. Turn it on again and the same snippet works.
Widget token and rotation
The Widget token is in the Embed code section. Use Copy token if you need the raw value.
When to rotate the token
Rotate the token when:
- You suspect the snippet is running on a site that is not yours.
- You hand your website over to someone else and want a fresh credential.
- You rotate tokens on a regular security schedule.
How rotation works
The old token stops working right away and Pegasus creates a new one. Visitor sessions that are already open keep working for up to 2 hours, so live conversations are not cut off, but every new page load needs the new snippet.
Click Rotate next to the token
The "Rotate widget token?" dialog explains the impact.Confirm
Pegasus creates a new token and updates the Embed code section.Update your website
Copy the new snippet and replace the old one on your site before open sessions expire.
Notification after rotating:
- Success: "Token rotated. Update your embed snippet."
- Failure: "Failed to rotate token."
The token is public, but still handle it with care. If it shows up somewhere unrelated, rotate it and tighten your Allowed websites list.
Allowed websites
The widget runs on any website that loads your snippet. To limit it to your websites, fill in Allowed websites.
How matching works
Each entry is a website address made of protocol, domain, and an optional port, such as:
https://example.comhttps://app.example.comhttp://localhost:3000
The address must match exactly. https://example.com does not include https://www.example.com.
Add or remove a website
Open Allowed websites
Go to the Embed tab for the bot.Enter the full address
Include the protocol. If the value is not valid, Pegasus shows "Enter a valid URL (e.g. https://example.com)".
Click Add
The website shows up in the list right away.
Click the remove button next to an entry to delete it. The change applies right away to new sessions.
Empty list means any website
When the list is empty, Pegasus shows "Any website can show this widget." That is fine for testing, but do not leave it that way in production.
Local development and wildcard limits
- Add
http://localhost:3000, or the local port you actually use. - Do not test from
file://pages; run a local web server. - Wildcards such as
*.example.comare not supported, so add each subdomain separately.
Open sessions after a change
If you remove a website, visitor sessions already open on that site can finish their current message, but no new session can start there.
Match the widget to your website
The Appearance section of the Embed tab changes how the widget looks. A preview next to the fields shows the open chat and the chat button as you edit.
| Setting | What it changes |
|---|---|
| Presets | Ready-made color pairs; the first one is the default black-and-white widget |
| Main color | Header, chat button, send button and visitor messages |
| Background color | Chat area and bot messages |
| Greeting | The line visitors see before the first message, up to 160 characters |
| Message box hint | The hint inside the empty message box, up to 60 characters |
Text and icons switch between dark and light on their own, so they stay readable on any color, including a white chat button. Leave a text field empty to use the English default. Other widget labels stay in English.
Click Save appearance. Your website picks up the change on the next page load; you do not need to paste the snippet again. Reset to default returns every setting to the default widget. The widget also shows the bot's current name and avatar, so renaming the bot updates your site the same way.
After enabling
Once the widget is live, you can rotate the token, limit the allowed websites, or remove the widget to start over.