Framework recipes
| Framework | Recipe | Proxy option |
|---|---|---|
| Next.js App Router | next-app | route handler |
| Next.js Pages Router | next-pages | API route |
| React + Vite (any SPA) | react-vite | host function or worker |
| Astro | astro | SSR endpoint or worker |
| WordPress | wordpress | REST route |
| Webflow and plain HTML | webflow-html | Cloudflare Worker or CNAME |
| Shopify | shopify | app proxy or worker |
| Anything else | other | any proxy recipe |
Every recipe starts without a proxy – the snippet talks to the 3x API directly and works within minutes. The proxy is an optional second step that protects against ad blockers and keeps visitor separation exact (why).
How recipes are structured
Recipes are written in a fixed format so they can be rendered with real values: the dashboard's
install page, GET /v1/setup/instructions, GET /v1/projects/{project}/setup/snippet and the MCP
tools setup_get_instructions / setup_generate_snippet all read these pages.
- Sections, in this order:
## Install,## Verify,## Proxy (optional),## Consent,## Events. - Code fences carry an info string
lang path=<file> action=create|edit|append:- with a
path, the block is file content (createa new file,editan existing one – the block shows the relevant part,appendto the end); sh/bashblocks without a path are commands to run;env/dotenvblocks are environment variables (KEY=VALUE); names containingKEY,SECRET,TOKENorPASSWORD(without a public prefix such asNEXT_PUBLIC_) are secrets.
- with a
- Placeholders are filled with the project's values:
| Placeholder | Value | Default in these docs |
|---|---|---|
{{PUBLISHABLE_KEY}} | the project's publishable key | pk_3x_YOUR_PUBLISHABLE_KEY |
{{API_ORIGIN}} | the 3x API origin | https://api.3x.example |
{{PROXY_PATH}} | first-party proxy path on your site | /n3 |
{{PROXY_KEY_ENV}} | env variable holding the proxy key | X3_PROXY_KEY |
A test in packages/docs parses every recipe and fails the build when a section, an action or a
placeholder is wrong, so the machine-readable form cannot rot.