---
title: "Install Togo with your AI agent"
description: "Paste one line into your coding agent. It connects to Togo, installs the SDK, and proves the events arrive."
canonical: "https://www.togohq.ai/docs/install"
applies_to: "mcp.togohq.ai/mcp, @togohq/sdk-browser 1.x, @togohq/sdk-node 1.x"
updated: "2026-11-03T00:00:00Z"
---

# Install Togo with your AI agent

Paste one line into your coding agent. It connects to Togo, installs the SDK, and proves the events arrive.

## Paste this into your agent

Open your app's folder in Claude Code (or another coding agent) and send it:

```text
Add Togo analytics to this app. Instructions: https://www.togohq.ai/agents.md
```

That is the whole install. The agent reads the instructions at
[www.togohq.ai/agents.md](https://www.togohq.ai/agents.md), connects itself to Togo, and does
the rest. You only step in for three things: signing in, answering a question when it is unsure,
and deploying.

## What you will be asked to do

1. **Start a new session and sign in.** Claude Code installs the Togo plugin, then asks you to
   start a new session in the same folder, run `/mcp`, choose **plugin:togo:togo** and sign in. Your browser
   opens Togo's sign-in page. New to Togo? Sign up on the same page and you come back to the
   approval.
2. **Approve access.** The browser asks what the agent may do. Choose **Read and change** so it can
   set the project up; you can connect a read-only agent later for questions.
3. **Click through your app once**, if the agent cannot run it. It needs each flow — sign up, the
   main action, purchase — to happen once, with the test key, so it can check the events.
4. **Deploy.** The agent puts the live key in production builds. After you deploy, it confirms
   the first live events.

## What the agent does

The instructions point it at the setup playbook on Togo's MCP server
([`get_setup_instructions`](/docs/reference/mcp-tools#get_setup_instructions)). In order, it:

1. Finds your project — by the write key already in your code, or the empty project your signup
   made. [One product is one project](/docs/concepts/projects): its website, apps and server
   together.
2. Gives this part of your system its own pair of write keys, named for it (`web-app`,
   `api-server`).
3. **Defines your tracking plan before writing code**: each event with what it means and when it
   fires, and each profile property. It reads the flows in your code, and any PostHog, Mixpanel or
   Amplitude calls already there. That plan is what keeps your data trustworthy —
   [Event governance](/docs/concepts/governance).
4. Installs [`@togohq/sdk-browser`](/docs/reference/sdk-browser) for browser code and
   [`@togohq/sdk-node`](/docs/reference/sdk-node) for server code, with the test key in
   development and the live key in production, both read from environment variables.
5. Adds `identify()` at sign-in and `reset()` at sign-out.
6. Proves it: runs the flows and checks that run with
   [`verify_tracking`](/docs/reference/mcp-tools#verify_tracking), fixing what it reports until
   every expected event, identify call and profile property has arrived with nothing to fix.
7. Tells you what it defined, which keys each system uses, and anything it created.

## Which agents work

Claude Code runs the whole flow, end to end — [Connect Claude Code](/docs/mcp/claude-code). Any
agent that can add a remote MCP server with OAuth sign-in follows the same instructions — see
[Other agents](/docs/mcp/other-agents). Prefer to install by hand? Start from
[Next.js](/docs/nextjs), [React](/docs/react) or [plain HTML](/docs/html).

## What the agent never asks you for

A secret key, an admin key or an API token. Togo's write keys are public and can only send events;
the sign-in your browser approves is the only credential the agent holds. Anything that asks you
for a secret to install Togo is not Togo.
