> For the complete documentation index, see [llms.txt](https://docs.fastn.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.fastn.ai/embed/embedding.md).

# Embed in your product

Three ways to put the widget in your product, and how to hand it a token safely.

**Embed → Widget → Embed**

## Pick the customer first

The widget is always scoped to **one** of your customers, so the dropdown labelled **User** at the top is not a preview toggle. It decides who the generated snippet is for.

The dropdown lists the customers on your account by name. Selecting one does two things at once:

* the preview beside it shows **that customer's real connection state**, not a mock-up, so `TikTok Shop, 0 of 1 connected` is the truth for that customer
* the **Embed Code** block regenerates with a token scoped to them

If you have no customers yet, the **User** dropdown does not appear. Instead a card reads **No customers yet - this is a template**, the snippet uses placeholders, and a **Create a customer** button takes you to [Customers](/operate/customers.md). Once a customer exists, a live token replaces the placeholders.

Then choose how to mount it.

| Method     | Requirement               | Status      |
| ---------- | ------------------------- | ----------- |
| **Iframe** | Anywhere you control HTML | Available   |
| **SDK**    | You can run JavaScript    | Available   |
| **A2A**    | Agent-to-agent            | Coming soon |

{% hint style="danger" %}
**The snippet on this tab contains a live token.** It is there so you can paste it and see the widget working in seconds, and it is not safe for production: anyone with the URL can act as that customer until the token expires.

For production, mint short-lived tokens from your backend and keep them out of the URL. The [SDK](/embed/embedding/sdk.md) is built for that pattern, and the [Token API](/embed/embedding/token-api.md) is how you mint them.
{% endhint %}

## Shareable links

Instead of a snippet, send a link. It keeps working until it expires or you revoke it, and the URL carries no token. Shareable links live on the **Iframe** sub-tab.

{% hint style="warning" %}
The reference in a shareable link *is* the credential. Treat the link itself as a secret: anyone who has it can act as that customer.
{% endhint %}

#### Creating one

1. Go to **Embed → Widget → Embed**, stay on the **Iframe** sub-tab, and pick the customer in the **User** dropdown. **Create link** stays disabled until you do - with nobody selected the card reads *Pick a customer above first.*
2. In the **Shareable links** card, set **New links** to the expiry you want: **Never expire** (the default), **Expire in 1 day**, **Expire in 7 days** or **Expire in 30 days**.
3. Select **Create link**.
4. The new row appears badged **New**.

Each row identifies itself by the last few characters of its id rather than printing the credential as a headline, and carries its own state:

| State            | Meaning                                 |
| ---------------- | --------------------------------------- |
| **Never used**   | Created, not yet opened.                |
| **Used N times** | How many times it has been opened.      |
| **Revoked**      | You revoked it. It will not load.       |
| **Expired**      | It passed its expiry. It will not load. |

**Copy** works without revealing anything. **Show** reveals the URL on that row, on request only. **Revoke** is immediate, and a revoked or expired link offers neither - handing one over is only a way to give someone something that will not load.

A shareable link suits the cases where you cannot embed at all: onboarding a customer before they have access to your product, letting someone connect their accounts from an email, or handing a link to a customer's IT team to authorize on their behalf. **Revoke** is immediate, and it is the only way to withdraw one.

### In this section

* [Iframe](/embed/embedding/iframe.md)
* [SDK](/embed/embedding/sdk.md)
* [Token API](/embed/embedding/token-api.md)
* [Integration flow](/embed/embedding/integration-flow.md)


---

# 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.fastn.ai/embed/embedding.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.
