What you need
- A Next.js project using the App Router. The setup also handles Pages Router and other frameworks, but this guide follows the App Router.
- Claude Code running in the project’s folder.
- A Wendung account. Sign up without a card; your first workspace starts a 14-day trial of the Starter plan and then moves to the Free plan. See Plans and limits.
Setup
1
Create a project and copy its key
In the dashboard, create a project for the app. Open the project’s Settings → API keys and copy the key named Default. It starts with
pk_. A publishable key is safe in frontend code, and ingest accepts it only from your allowed origins, so you can paste it into the chat.A new project starts with Dev mode on, so it accepts events from localhost for its first 24 hours. If your project is older, turn on Dev mode under Settings → Allowed origins. It can take a few minutes to take effect.2
Run the setup prompt
Paste this prompt into Claude Code:Claude Code asks whether you have an account, a project, and the key, and whether Dev mode is on. Answer in one message. It then installs the
Prompt
wendung-sdk skill, which documents the SDK’s API so it can follow it instead of guessing method names or options. The setup prompt lists every step it follows.3
Review the plan
Before it edits any file, Claude Code reports what it found and proposes a funnel. For a typical SaaS app, the plan looks like this:
Check that each step marks a moment that matters to you and that the names are what you want to see in reports. Names are matched character for character, so changing them later means changing the code and the funnel.Claude Code also asks two things you decide:
- Pageviews. Whether to turn on pageview tracking for web analytics. The Free plan doesn’t include pageviews.
- Consent. How your app asks visitors for consent to analytics and restores their choice. If you have no consent banner yet, say so; the consent guide covers the options.
4
Approve and let it add the code
After you approve the plan, the setup prompt tells Claude Code to:
- install
@wendung/sdkand read the key from an env var, - call
Wendung.init()once in the browser, withdebugon in development, - set
consentfor the setup you chose and, if your app waits for the visitor’s choice, connectsetConsent()to your consent manager, - call
identify()when the user is known and consent is granted, including after a signed-in user grants consent, andreset()on logout, - add each
step()call where its milestone happens, - run your build, type check, and lint.
5
Allow your app's origins
In the project’s Settings → Allowed origins:
- Add your production origin, for example
https://app.example.com. - Turn Dev mode back on if it has switched off. It accepts events from localhost for 24 hours.
6
Check that events arrive
Run the app locally, accept analytics in your consent banner if the app has one, and trigger one of the steps, for example by signing up a test user. With
debug on, the browser console logs [Wendung] ingest accepted batch. The project’s Events page lists each request with its status. A rejected request shows the reason, such as an origin that isn’t allowed.7
Create the funnel
Under Funnels, create a funnel and pick the step names in order. Names that have already arrived appear in the step picker with their counts. See Creating a funnel. The Free plan includes one funnel per project.
Ask Claude Code where users drop off
Once real traffic has passed through the funnel, connect Claude Code to your Wendung data:/mcp, select wendung, and sign in to Wendung in the browser window that opens. New connections get read access by default.
Then ask questions that combine your data with your code, for example:
Prompt