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

# Developer overview

> The pieces of NextIntent for any website: the storefront SDK, the realtime collector, the decision engine, and card delivery, and what a site needs to run it.

NextIntent runs on any website, not only Shopify. The Shopify app is one client of the same NextIntent: it provisions a site, keeps the facts sheet in sync from the store, forwards orders, and renders the reports. This section is for a developer wiring a site up directly, or building on the API.

## The pieces

| Piece | Host | What it does |
| - | - | - |
| Storefront SDK | `sdk.nextintent.ai/<site_id>/sdk` | A script on every page. Reads how the visitor moves (scroll, clicks, stillness, form validation messages, page path) and streams it to the collector. Assigns the visitor id in a NextIntent-owned frame. |
| Realtime collector | a websocket the SDK opens | Receives the signals, stamps them with the site and visitor, and publishes them to the engine. Keeps nothing but the visitor and device registry. |
| Decision engine | internal | Folds each visitor's signals into a live picture, applies the gate (is this a moment?), decides whether to engage, composes the sentence from the facts sheet, and records the moment and what happened next. |
| Card delivery | `sdk.nextintent.ai/<site_id>/card` | Holds one sentence per visitor for three minutes; the page collects it once and reports shown, clicked or dismissed. |
| Commerce inputs | `sdk.nextintent.ai/<site_id>/cart`, `/shopify/orders`, `/shopify/refunds`, `/checkout` | The cart from the page, orders and refunds from the store's server, checkout steps from a pixel. |
| Management API | `api.nextintent.ai/v1` | Sites, switches, the facts sheet, the views (store, reasons, moments), API keys. |

## What a site needs

1. **A site record**, created in the NextIntent console or through `POST /v1/sdk` with a name and its allowed origins. This gives you the `site_id` and the site's public key.
2. **The SDK script** on every page. See [Install the SDK](/api/install-sdk).
3. **A facts sheet**: what the site is willing to have said on its behalf. Without one, the engine still records moments but has nothing to say. See [The facts sheet](/api/facts-sheet).
4. **A way to show the sentence**: the card snippet, your own listener for the `nextintent:moment` event, or a popup tool. See [The card and the event](/api/the-card).
5. **Commerce inputs**, if you want orders credited to moments: the cart beacon on cart pages and an order feed from your platform. See [Commerce endpoints](/api/commerce-endpoints).

## The signal envelope

Every signal the SDK emits has the same shape on the bus: `{ meta: { type, event_time, sdk_id, user_id, tab_id, source }, context: { page, ... }, payload }`. Browser types come through the collector with `source: "rtp"`; commerce types (`cart`, `order`, `refund`, `checkout`, `card`, `erase`) come from the SDK service with `source: "sdk"`. The engine refuses a commerce type from a browser source, so a page cannot claim an order happened.

## Rate limits and origins

Public storefront routes are origin-gated: a request whose `Origin` is not on the site's allowed list is refused before anything is read. The management API is limited to 600 requests a minute per key and 60 a minute per IP unauthenticated. See [Authentication](/api/reference/authentication).

## Related

* [Install the SDK](/api/install-sdk)
* [The facts sheet](/api/facts-sheet)
* [API overview](/api/reference/overview)
* [Data and privacy](/api/data-and-privacy)
