Antlytics logoAntlytics

Quick install

The fastest way to add Antlytics to any project:

npx @antlytics/init

That's it. The CLI detects your framework, opens your browser for one-click sign-in, and edits your project files automatically.


What it does

  1. Detects your framework — checks for next.config.*, nuxt.config.*, svelte.config.*, or astro.config.*. Asks if it can't tell.
  2. Opens your browser — a one-time authorisation page. No API key pasting. Sign in with your Antlytics account, confirm the code, click "Authorise."
  3. Installs the package — runs the right install command for your package manager (pnpm, npm, yarn, or bun).
  4. Edits your layout/config — inserts the <Analytics> component or module config with your tracking ID.
  5. Offers AI rules — optionally writes CLAUDE.md, .cursorrules, or .windsurfrules so your AI coding tool knows how to use Antlytics correctly.

Framework-specific behaviour

Next.js

Installs @antlytics/analytics, edits app/layout.tsx to add <Analytics trackingId="..." /> inside <body>.

Nuxt 3

Installs @antlytics/nuxt, edits nuxt.config.ts to add the module.

SvelteKit

Installs @antlytics/svelte, edits src/routes/+layout.svelte to add <Analytics trackingId="..." />.

Astro

Installs @antlytics/astro, edits astro.config.mjs to add the integration.

Plain HTML

Prints the <script> snippet and instructions. Does not edit HTML files automatically.


How to undo

Remove the <Analytics /> component (or module entry) from your layout file, then uninstall the package:

npm uninstall @antlytics/analytics   # or /nuxt /svelte /astro

Delete CLAUDE.md, .cursorrules, or .windsurfrules if you installed AI rules.


Troubleshooting

If npx @antlytics/init fails partway through, you can install manually:

Something missing? Get in touch and we will update these docs.