Neaten docs
Install one script tag, build tours by pointing at your own app, and keep them working as the app changes. Everything here is also available as plain text in llms.txt.
Install
Copy your snippet from the dashboard: Canvas shows it until Neaten sees it running on your site, and Settings → Sites & install always has it. It's one tag in the <head> of every page:
<script async src="https://cdn.tryneaten.com/v1/loader.js" data-key="pk_live_…"></script>
Then identify the signed-in user, in your app's own code. The id is a string (String(user.id) if yours is a number):
(window.neaten = window.neaten || []).push(["identify", user.id, { plan: user.plan }]);
Or with npm. The package adds the same loader, so fixes still reach your users without a redeploy, and does nothing during server rendering:
npm install @neaten/sdk
import { identify, init, onEvent, track } from "@neaten/sdk";
init({ key: "pk_live_…" });
identify(user.id, { plan: user.plan });
track("invoice_sent");
It works the same with React, Vue, Svelte, Angular, Next.js, Nuxt and server-rendered multi-page apps: tours follow your router with no adapter, and carry on across full page loads.
If your site sends a Content Security Policy, allow Neaten's two hosts (Content Security Policy). To make sure only your server can say who a user is, turn on identity verification. Every call, and how consent works, is in the SDK reference.
Tours as code
Tours are JSON files you can keep in Git. Create a secret key under Settings → API keys, then:
export NEATEN_API_KEY=sk_live_…
npx @neaten/cli pull # tours/<id>.json + .neaten/lock.json (commit both)
npx @neaten/cli diff # what you changed
npx @neaten/cli push # new drafts; nobody sees them yet
npx @neaten/cli publish first-invoice --env live
Before you merge a change to your app, check the published tours against the PR's preview deploy. It fails the build if a step can't find its element:
npx playwright install chromium
npx @neaten/cli check --base-url https://pr-123.preview.yourapp.com
On GitHub, add your secret key as the repository secret NEATEN_API_KEY and copy these two workflows. The first checks each pull request against its preview deploy:
# Copy to .github/workflows/neaten-check.yml. Runs after your preview deploy and fails the PR if a published tour
# step can't find its element on the new build. Set BASE_URL to however your previews are addressed. When the preview
# needs a login, add --storage-state <file> (a Playwright storage-state file); to check test tours, use --env test.
name: Neaten tour check
on:
pull_request:
jobs:
check:
runs-on: ubuntu-latest
steps:
- uses: actions/setup-node@v4
with:
node-version: 22
# The CLI loads Playwright from next to itself, so both come from one npx install (the same one in both steps),
# and the browser matches that Playwright.
- name: Install a browser
run: npx --yes -p @neaten/cli -p playwright@1 -- playwright install --with-deps chromium
- name: Check published tours against the preview
env:
NEATEN_API_KEY: ${{ secrets.NEATEN_API_KEY }}
BASE_URL: https://pr-${{ github.event.number }}.preview.yourapp.com
run: npx --yes -p @neaten/cli -p playwright@1 -- neaten check --base-url "$BASE_URL" --env live
The second publishes tour files when they change on main, and commits the updated lock:
# Copy to .github/workflows/neaten-publish.yml. When tour files change on main, save them and publish them live.
# Keep tours/ and .neaten/lock.json in the repository (neaten pull writes both).
name: Neaten publish
on:
push:
branches: [main]
paths: ["tours/**"]
jobs:
publish:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 22
- name: Publish changed tours
env:
NEATEN_API_KEY: ${{ secrets.NEATEN_API_KEY }}
run: npx --yes @neaten/cli push --dir tours --publish live --message "Published from ${GITHUB_REPOSITORY}@${GITHUB_SHA::7}"
# The lock now holds the new revisions: commit it so the next push starts from them.
- name: Commit the updated lock
run: |
git config user.name "neaten-bot"
git config user.email "neaten-bot@users.noreply.github.com"
git add .neaten/lock.json
if ! git diff --cached --quiet; then
git commit -m "Update Neaten lock"
git push
fi
MCP
Coding agents can read and edit tours, and check what depends on an element before renaming it. Remote, with a secret key:
claude mcp add --transport http neaten https://api.tryneaten.com/mcp --header "Authorization: Bearer sk_live_…"
Or locally over stdio:
{
"mcpServers": {
"neaten": {
"command": "npx",
"args": [
"@neaten/mcp"
],
"env": {
"NEATEN_API_KEY": "sk_live_…"
}
}
}
}
Send tour events to your analytics
Every tour event reaches onEvent. Settings → Integrations has ready-made snippets for Segment, PostHog, Google Analytics 4, Amplitude and Mixpanel. onEvent runs whatever the person agreed to, so forward only what your consent tool allows.
(window.neaten = window.neaten || []).push(["onEvent", (e) => {
analytics.track("Neaten " + e.e, { tour: e.tour, step: e.step, group: e.arm });
}]);