Skip to content
Start a projectStart

Analytics

Know what people do in your product, and what breaks. PostHog with typed events, errors and feature flags, cookieless by default.

What it adds

  • packages/analytics, built on PostHog. Events are typed in packages/analytics/src/events.ts, so a misspelled event fails the typecheck.
  • Page views, events from the server, and feature flags.
  • Error tracking with readable stack traces: builds upload their source maps.
  • The /ingest proxy, so events go through your own domain.
  • Cookieless counting: visitors who haven’t accepted cookies are counted without them.

Set it up

  1. Create a PostHog project on US or EU Cloud. Set NEXT_PUBLIC_POSTHOG_KEY to the project token (phc_…) and NEXT_PUBLIC_POSTHOG_HOST to https://us.i.posthog.com or https://eu.i.posthog.com.
  2. In the project settings, turn on Cookieless server hash mode. Without it, PostHog drops the events of visitors who haven’t accepted cookies.
  3. Optional, for readable stack traces: a personal API key with error-tracking write access in POSTHOG_API_KEY, and the project ID in POSTHOG_PROJECT_ID.

Without the key, analytics is off and nothing breaks.

Before launch

  • Cookieless server hash mode is on.
  • POSTHOG_API_KEY and POSTHOG_PROJECT_ID are set in production.
  • A test visit shows up in PostHog, through /ingest.
  • The privacy policy names PostHog.

Leave it out or add it later

Leave analytics out of --modules to start without it. With the Consent banner on too, PostHog follows each visitor’s choice. To add Analytics to an existing project, ask your agent to use the add-module skill.

Run one command. The CLI asks the rest, and your agent takes it from there.

pnpm create turbinekit my-app
See the prompt

Paste it into an agent that can run commands, such as Claude Code, Codex or Cursor.

Create a new TurbineKit project with me.

TurbineKit (https://turbinekit.dev) is an open-source Turborepo and Next.js starter. Its CLI, create-turbinekit, needs Node.js 24 and pnpm 10 (run `corepack enable` once).

1. Run `pnpm dlx create-turbinekit --help` to see its options.
2. Ask me its questions one at a time, with their defaults: the folder, the product name, one sentence about the product, the company or legal name, the contact email, the languages and the modules. Skip what I have already told you.
3. The CLI only asks questions in an interactive terminal, so run it with my answers as options and `--yes`. Show me the command before you run it.
4. In the new folder, read AGENTS.md. Then do "1. Minimal setup" in SETUP.md, and tick each box you finish.
5. Tell me the URL of the running app, and which services SETUP.md lists next.

No sign-up, no API keys. Needs Node.js 24 and pnpm 10.