1. Check the user’s account
If thewendung MCP server is connected, look up the user’s workspaces and projects with it first and skip the questions it answers. Ask the remaining questions in one message, then wait for the answers:
- Do you have a Wendung account? If not, send the user to https://dashboard.wendung.app/auth/sign-up and remind them to confirm their email address. If they have one, they can sign in at https://dashboard.wendung.app/auth/sign-in.
- Do you have a project for this app? If not, tell the user to create one in the dashboard. A new account creates a workspace first, then the project.
- Do you have the project’s API key? It is the key named Default under the project’s Settings → API Keys and starts with
pk_. The key is publishable, so the user can paste it into the chat or add it to the env file themselves.
2. Install the Wendung skill
wendung-sdk skill for every SDK detail. If the install fails or the skill is not available in this session, read https://docs.wendung.app/skills/wendung-sdk.yaml instead. Do not guess at the API.
3. Read the codebase and propose a plan
Tell the user what you found: the framework and router, where the app starts in the browser, how login and logout work, how env vars are loaded, and whether Wendung or a consent banner is already set up. Then propose a funnel: an ordered list of step names in snake_case and past tense, such assignup_completed, with the file and the moment each step happens. Confirm the production and local origins the app uses. Ask whether the user wants pageview tracking for web analytics, which the free plan does not include, and how the app obtains and restores the visitor’s analytics choice. If pageviews are wanted, distinguish full pageviews after consent from aggregate pageviews while pending.
Wait for the user to approve the plan before you change any files.
4. Add Wendung
After the user approves the plan and you have the key:- Install
@wendung/sdk, or use the script tag if the site has no build step. - Read the key from an env var and call
Wendung.init()once at startup, in the browser only. Keep optional settings in that same call. Turn ondebugin development. - Set
consentexplicitly for the agreed setup. If the app waits for a choice, restore the saved value or start with'pending', and connectsetConsent()to the consent manager. The SDK does not store the choice, and omitting the option defaults to'granted'. - Leave
trackPageviewsoff unless requested. Usetruefor full pageviews after consent, or'auto'for aggregate pageviews while pending and full pageviews after consent. Denial stops both. - Call
Wendung.identify()when the user is known and consent is granted, including after consent changes for an already signed-in user. Calls made while pending are dropped. CallWendung.reset()on logout. - Add each
Wendung.step()call where its milestone happens. - Run the project’s build, type check, and lint.
5. Allow the app’s origins
A new project rejects every event with HTTP403 until its origin is allowed, including localhost. Tell the user to open the project’s Settings → Allowed origins, add the production origin, and turn on Dev mode to test from localhost for 24 hours. If the wendung MCP server has write access, offer to do this with update_project instead.
6. Check that events arrive
Help the user run the app locally, apply the visitor’s consent choice, and trigger one of the steps with granted consent. Withdebug on, the browser console logs [Wendung] ingest accepted batch when ingest accepts the request. Confirm delivery status on the project’s Events page in the dashboard. If a batch is rejected, find the cause in the skill’s debugging section.
7. Summarize
List every file you changed and the step names you added. Then tell the user what to do next:- Create a funnel from these step names under Funnels in the dashboard.
- If pageviews are on, register the hostname under Sites.
- To ask questions about their data from the agent, connect the Wendung MCP servers with https://docs.wendung.app/prompt.md.