> For the complete documentation index, see [llms.txt](https://docs.peakcommerce.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.peakcommerce.com/product/settings/developer-tools/widget-embed.md).

# Widget Embed

**Settings → Widget Embed** manages keys for the embeddable **AI chat widget** you can drop onto any website — a floating chat bubble that lets visitors talk to one of your AI agents without logging in.

## Why it matters

The widget brings PeakCommerce's conversational AI to pages you don't host inside the platform — a marketing site, a help center, a landing page. Visitors can ask product inquiries, get support, and take commerce actions in the same chat, with no account required.

## Create and embed

1. **Create a widget key.** Choose **which AI agent powers it** (the agent's instructions and tools define what the chat can do) and customize its appearance.
2. **Copy the embed snippet** — a small script tag scoped to that key.
3. **Paste it into your site's HTML, just before the closing `</body>` tag.**
4. Reload the page; the widget appears as a floating chat bubble.

## How to use it

* Use **separate keys** for different sites or agents so you can tune behavior — or revoke one — independently.
* Pick the agent deliberately: a support-focused agent and a sales/commerce agent give visitors very different experiences.

## Gotchas and security

* The key is embedded in **public client-side HTML**, so it is visible to anyone. It authorizes only the scoped widget chat — never reuse an [API key](https://docs.peakcommerce.com/product/settings/developer-tools/api-keys.md) here.
* Visitors are **unauthenticated**, so the powering agent should expose only actions safe for anonymous users.
* Removing or revoking the key disables the widget on every site using that snippet.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.peakcommerce.com/product/settings/developer-tools/widget-embed.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
