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
- Detects your framework — checks for
next.config.*,nuxt.config.*,svelte.config.*, orastro.config.*. Asks if it can't tell. - Opens your browser — a one-time authorisation page. No API key pasting. Sign in with your Antlytics account, confirm the code, click "Authorise."
- Installs the package — runs the right install command for your package manager (pnpm, npm, yarn, or bun).
- Edits your layout/config — inserts the
<Analytics>component or module config with your tracking ID. - Offers AI rules — optionally writes
CLAUDE.md,.cursorrules, or.windsurfrulesso 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: