Custom Embed
Add the agent to any website with one script tag.
How it works
The embed system has three parts:
- -embed.js (~2KB) — a loader script you paste on your site
- -iframe — the loader injects a transparent iframe that renders the widget
- -AgentWidget — the chat UI running inside the iframe, connected to your agent via WebSocket
Basic embed
<!-- Paste before </body> -->
<script
src="https://clearly.sh/embed.js"
data-site-key="ck_live_your_site_key"
data-theme="auto"
data-greeting="Hi! How can I help you today?"
></script>Configuration attributes
| Attribute | Values | Default | Description |
|---|---|---|---|
| data-site-key | ck_live_xxx or ck_test_xxx | (required) | Your site key from the dashboard |
| data-position | bottom-right, bottom-left | bottom-right | Widget position on the page |
| data-theme | auto, light, dark | auto | Color scheme (auto follows system preference) |
| data-greeting | Any text (200 chars max) | "" | Greeting message shown on first visit |
Platform-specific instructions
Shopify (without the app): Go to Online Store → Themes → Edit Code → theme.liquid → paste before