---
title: Set up Amplitude with an AI coding assistant
description: "Copy a prompt into Cursor, Claude Code, Copilot, or another AI coding tool to install and configure the Amplitude Browser SDK in a JavaScript web app."
product: general
lang: en
last_updated: 2026-10-21
token_estimate: 585
---
# Set up Amplitude with an AI coding assistant

> For AI agents: a documentation index is available at [/docs/llms.txt](/docs/llms.txt). Append `.md` to any page URL for markdown, or send `Accept: text/markdown`.

An AI prompt is a low-code way to set up the Amplitude Browser SDK in a JavaScript web app. Copy the prompt into an AI coding tool, and the tool makes the code changes for you. Use this option when you want an AI tool to make the code changes instead of running a full manual install.

The prompt sets up:

- Full SDK setup for a JavaScript web app.
- [Autocapture](https://amplitude.com/docs/data/autocapture) and [Session Replay](https://amplitude.com/docs/session-replay).
- Remote config for feature flags and guides.

To have an AI agent also read your codebase and choose which events to instrument, use the [Amplitude Wizard CLI](https://amplitude.com/docs/get-started/setup-wizard-cli) instead.

## Prerequisites

- An Amplitude project and its API key. Create a [free Amplitude account](https://app.amplitude.com/signup) if you still need one.
- An AI coding assistant that can edit your project.

## Run the setup prompt

1. **Copy the prompt into your AI tool**

   Paste it into Cursor, Claude Code, Copilot, or another coding assistant that can edit your project. Click the **API key** button in the code block to insert your key before you copy the prompt.

   ```text
   Install and configure Amplitude for this JavaScript web application.

   Use API key: AMPLITUDE_API_KEY

   Requirements:
   - Run the implementation only on the client.
   - Initialize Amplitude once during app load.
   - Install the correct browser package for this project.
   - Enable fetchRemoteConfig: true.
   - Enable autocapture for attribution, page views, sessions, element interactions, form interactions, and file downloads.
   - Enable Session Replay with sampleRate: 1.
   - Preserve the project's existing TypeScript and framework patterns.
   ```
2. **Review the generated changes**

   Confirm that the assistant installed the SDK, initialized it in the right client entry point, and kept the code client-side.
3. **Verify that events arrive**

   After the changes land, open the [Amplitude Debugger](https://amplitude.com/docs/analytics/debug-analytics) and confirm that page views and session data reach your project.

