> ## Documentation Index
> Fetch the complete documentation index at: https://docs.widgetic.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Integrations

> Build from an assistant or a terminal, put widgets on any page, keep their content in sync, and react to what visitors send

Widgetic works with the tools around it in five ways. The ready-made connectors for each are on [widgetic.com/integrations](https://widgetic.com/integrations). This page is for what you can set up yourself, with the embed code, the API, MCP and webhooks, where there is no connector or you would rather do it in code.

## The Five Ways

| On widgetic.com | What it is for | How to do it yourself |
| - | - | - |
| **Build from** | Starting a widget from the assistant, chat or tool you already work in | [Build From Your Assistant or Terminal](#build-from-your-assistant-or-terminal) |
| **Put widgets inside** | Showing a widget in a store, a help center, a chat, a CRM page, a link page or any site | [Embed Code](#embed-code) and [Where to Put It](#where-to-put-it) |
| **Keep content in sync** | A widget that changes when its source does | [Keep Content in Sync](#keep-content-in-sync) |
| **Automate** | Creating widgets and updating live content from any app | [Automate](#automate) |
| **Sales follow-up** | Sending what visitors answer to the tools where your team follows up | [React to What Visitors Send](#react-to-what-visitors-send) |

## Build From Your Assistant or Terminal

Connect an MCP client to `https://mcp.widgetic.com` and describe the widget in plain words. The assistant builds it, shows a preview, publishes it and gives you the embed code. [Connect an assistant](https://docs.widgetic.com/docs/agents/connect.md) has the steps for ChatGPT, Codex, Cursor, Claude Code, VS Code and any other client, and [AI agents (MCP)](https://docs.widgetic.com/docs/agents/overview.md) says what you can ask for. The [CLI](https://docs.widgetic.com/docs/cli/getting-started.md) makes any call of the API from a terminal or a script.

## Embed Code

A widget is shown on a page through a composition, and the page needs only the composition id: there is no key in the page. This is the code that every example below uses. Put your own composition id in it:

```html theme={"theme":"css-variables"}
<script src="https://cdn.widgetic.com/sdks/browser/embed-sdk.js?v=6"></script>
<widgetic composition-id="YOUR_COMPOSITION_ID" resize="fill-width" width="800" height="450" autoscale="on" adaptive="480" embed-target="site"></widgetic>
```

The Embed tab writes the same code from the composition's saved settings. See [Embedding widgets](https://docs.widgetic.com/docs/api/embedding.md) for what each attribute does.

> [!NOTE]
>
> If you limit the websites that may show your widgets, add every address that will show one, including preview and staging addresses. A page on an address that is not on the list shows nothing. See [Security](https://docs.widgetic.com/resources/security.md).

## Where to Put It

Paste the embed code wherever the platform lets you add custom HTML.

### WordPress

1. Add a "Custom HTML" block
2. Paste the embed code
3. Update the page

### Webflow

1. Add an Embed element
2. Paste the embed code
3. Publish your site

### Shopify

1. Open the theme editor and add a "Custom Liquid" section where the widget should go
2. Paste the embed code
3. Save the theme

### Places That Take an Address, Not a Script

A chat messenger, a link page, a site builder or a notes tool often takes an address or an iframe and no script. A composition has a frame for that (see [Use iframe](https://docs.widgetic.com/docs/api/embedding.md#use-iframe-a-frame-with-no-script)), and so does a workflow: `https://api.widgetic.com/embed/workflows/YOUR_WORKFLOW_ID/frame`. See [Show a workflow where you cannot add a tag](https://docs.widgetic.com/docs/api/embedding-workflows.md#show-a-workflow-where-you-cannot-add-a-tag) for the frame, for the oEmbed card, and for what a workflow cannot do inside a frame: it moves a visitor on only by what the frame can see itself, so a step that waits for an event from your page does not start there.

### Email

Email programs do not run scripts or embedded frames, so a widget cannot run inside an email. Send a static image of your own (a screenshot of the widget) that links to a page where the widget is embedded:

```html theme={"theme":"css-variables"}
<!-- Email template -->
<a href="https://your-site.com/interactive-widget">
  <img src="https://your-site.com/images/widget-preview.png" 
       alt="Interactive Widget" />
</a>
```

## Keep Content in Sync

The embed shows what its composition holds, so a widget stays current when the new content is saved to the composition. Do that from your server, or from any job that can send an HTTPS request, whenever the source changes: a product catalogue, a price list, a sheet, a list of scores. The tag on the page stays the same and every page that embeds the composition shows the change. See [Compositions](https://docs.widgetic.com/docs/api/compositions.md#content-design-and-embed) for how to save content, and [Scripts and CI](https://docs.widgetic.com/docs/cli/scripts-and-ci.md) for running it from a scheduled job.

* **Product configurators.** Save your product data to the composition whenever your catalogue changes.
* **Pricing calculators.** Save your plans and prices to the composition, and every page that embeds it shows them.

> [!NOTE]
>
> This page does not document a way for the `<widgetic>` tag to hand a visitor's choice back to your page, for example to add a configured product to a cart. Build that step on your own page, around the embed.

## React to What Visitors Send

Some widgets collect something from the people who use them: votes, ratings, answers, sign-ups. These are the entries of a composition. To get them to the tools where your team follows up, a CRM, a help desk or a spreadsheet, your server can read them when it likes ([Read What Visitors Sent](https://docs.widgetic.com/docs/api/compositions.md#read-what-visitors-sent)), or be told when one arrives, and pass it on.

Widgetic can call your server in two ways, and both are signed in the same way (see [Verify signatures](https://docs.widgetic.com/docs/webhooks/verify-signatures.md)):

* **Partner webhooks.** A partner account can have a signed call made to its own server when an invoice is paid, when its credits run low, when a customer's composition is created or saved, when a visitor sends an entry, and for the other [events](https://docs.widgetic.com/docs/webhooks/events.md). See [Partner webhooks](https://docs.widgetic.com/docs/webhooks/partner-webhooks.md) for how to set the address.
* **MCP events.** Any workspace on a plan with API access can be called when a visitor sends an entry into one of its published widgets. See [MCP events](https://docs.widgetic.com/docs/webhooks/mcp-events.md).

A workspace that is not a partner has no webhook for its own invoices, credits or widgets, and there is no Webhooks page in the dashboard. [Webhooks and events](https://docs.widgetic.com/docs/webhooks/overview.md) compares the two.

## Automate

Creating a widget, saving a composition's content and reading entries are API calls, made from your server with an [API key](https://docs.widgetic.com/docs/api-keys.md). Make them from a library (Widgetic publishes one for TypeScript, Python, Go, Java, C#, Ruby, PHP and Bash: see [SDKs](https://docs.widgetic.com/docs/sdks/overview.md)), from the [CLI](https://docs.widgetic.com/docs/cli/getting-started.md) in a scheduled job or in [GitHub Actions](https://docs.widgetic.com/docs/cli/scripts-and-ci.md#github-actions), or from any automation tool that can send an HTTPS request. For any other language, send HTTPS requests to the REST API: every endpoint in the [API Reference](https://docs.widgetic.com/api-reference/introduction.md) has a cURL sample, and the [OpenAPI description](https://raw.githubusercontent.com/widgetic/docs/main/openapi/widgetic-api-public.json) can feed a generator of your own.

## Measure

To count how many visitors actually see a widget in your own analytics tool, send an event once it scrolls into view. (A partner account also sees the views, interactions and visitors of its customers' compositions in the [dashboard](https://docs.widgetic.com/docs/partners/dashboard.md#analytics).)

### Google Analytics

```typescript theme={"theme":"css-variables"}
const widgetElement = document.querySelector('widgetic[composition-id="YOUR_COMPOSITION_ID"]');

if (widgetElement) {
  const viewObserver = new IntersectionObserver((entries) => {
    if (entries.some((entry) => entry.isIntersecting)) {
      gtag('event', 'widget_viewed', {
        event_category: 'Widget',
        event_label: 'YOUR_COMPOSITION_ID'
      });
      viewObserver.disconnect(); // Count each page view once
    }
  }, { threshold: 0.5 });

  viewObserver.observe(widgetElement);
}
```

### Mixpanel

```typescript theme={"theme":"css-variables"}
const widgetElement = document.querySelector('widgetic[composition-id="YOUR_COMPOSITION_ID"]');

if (widgetElement) {
  const viewObserver = new IntersectionObserver((entries) => {
    if (entries.some((entry) => entry.isIntersecting)) {
      mixpanel.track('Widget Viewed', {
        composition_id: 'YOUR_COMPOSITION_ID'
      });
      viewObserver.disconnect();
    }
  }, { threshold: 0.5 });

  viewObserver.observe(widgetElement);
}
```

## Start From What You Build

The audience pages of widgetic.com show what each kind of team puts on the page. This is where to go in these docs for each.

| You work on | What people put on the page | Where to go next |
| - | - | - |
| [An online store](https://widgetic.com/for/ecommerce) | Product finders, quizzes, entry forms and timed offers beside the catalogue | [Shopify](#shopify), [Keep Content in Sync](#keep-content-in-sync) |
| [Campaigns and landing pages](https://widgetic.com/for/brands) | Contests, quizzes, polls and lead forms | [Embed Code](#embed-code), [React to What Visitors Send](#react-to-what-visitors-send) |
| [A newsroom or a blog](https://widgetic.com/for/newsrooms) | Explorable numbers, timelines, live scores and reader polls | [Where to Put It](#where-to-put-it), [Keep Content in Sync](#keep-content-in-sync) |
| [An agency](https://widgetic.com/for/agencies) | A prototype the client can click through, then the same embed on every client's site | [Embed Code](#embed-code), [API keys](https://docs.widgetic.com/docs/api-keys.md) (one for each client's workspace) |
| [A startup or a product team](https://widgetic.com/for/startups) | Live demos, and pricing or ROI calculators beside the sign-up | [Embed Code](#embed-code), [Measure](#measure) |
| [A developer team](https://widgetic.com/for/developers) | One tag that every edit reaches, changed from a terminal or an assistant | [Automate](#automate), [Build From Your Assistant or Terminal](#build-from-your-assistant-or-terminal), [Events from the embed](https://docs.widgetic.com/docs/api/embedding.md#events-from-the-embed) |


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.