For AI agents: a documentation index is available at /docs/llms.txt. Append .md to any page URL for markdown, or send Accept: text/markdown.
Set up Amplitude with a coding agent
This feature is in Early Access. During this time, aspects of the functionality may still be developed, and this documentation may not always be up to date. If you have any questions, contact Amplitude Support.
Agentic Setup gives your coding agent stack-specific instructions for adding Amplitude to a web, mobile, or backend app. Use Agentic Setup when you want the agent to inspect an existing codebase, instrument one meaningful event, and check whether the project receives data. To select the SDK and write the integration yourself, follow Get data into Amplitude instead.
Agentic Setup uses the Amplitude CLI to retrieve maintained setup skills. The coding agent chooses a skill based on your app's stack, makes the implementation changes, and guides you through triggering the event. For supported frameworks, setup also enables Default Event Tracking and Session Replay.
Agentic Setup is part of a 50/50 experiment for eligible users. The coding-agent setup option appears only when your account is in the Agentic Setup treatment.
Set up your app
- In Amplitude, open your project's Setup page.
- Select the coding-agent setup option and copy the generated prompt.
- Open your app's repository in your coding agent and paste the prompt.
- Review the app root, project, region, and candidate events that the agent identifies.
- Select one meaningful event from your app. The agent retrieves the relevant skill and implements the SDK integration for that event.
- Run the app and perform the action that triggers the event when the agent asks you to.
- Let the agent run the ingestion check, then review its implementation changes before you commit them.
Agentic Setup uses your public, ingestion-scoped project API key. It doesn't require an Amplitude Secret Key or a CLI login to retrieve setup skills and check ingestion. Never give the agent a Secret Key for this workflow.
How the coding agent uses the Amplitude CLI
The setup prompt includes your project context and tells the coding agent how to obtain a compatible version of the Amplitude CLI. The agent then retrieves the integrating-amplitude skill for your data region. For example, the US command is:
amp skills get integrating-amplitude --region us
The skill routes the agent to instructions for your framework and event type. Those instructions cover the SDK installation, initialization, event instrumentation, and verification sequence. Agentic Setup supports client-side, server-side, and native stacks without requiring the agent to select among Amplitude SDKs from general documentation.
After you run the app and trigger the selected event, the agent uses your project API key to run a bounded ingestion check. For example, the US command is:
amp events check-ingestion-by-api-key \
--api-key <PROJECT_API_KEY> \
--region us \
--timeout-seconds 60
The ingestion check reports whether the project received any recent event. It doesn't identify the selected event, count occurrences, or prove when a specific event arrived. If the check doesn't observe ingestion, use the live event feed on the project's Setup page to confirm the selected event.
Review the implementation
Before accepting the coding agent's changes, confirm that:
- The agent initialized Amplitude once in the correct app and runtime.
- The implementation sends the event name you selected.
- The project API key and data region match the intended Amplitude project.
- Default Event Tracking and Session Replay settings preserve your existing consent, opt-out, masking, sampling, and remote configuration choices.
- The repository contains no Secret Key or other private credential.
The coding agent offers to commit the changes after setup succeeds. Review the diff and test the app before approving that commit.
Was this helpful?