---
title: Installation | ReplayPilot Docs
description: Add ReplayPilot to your site with one script tag, no SDK or build step.
canonical: https://replaypilot.com/docs/getting-started
---

# Installation | ReplayPilot Docs

Search docs…⌘KBrowse docs

Get started
- [Installation](/docs/getting-started)
- [What's new](/docs/whats-new)

Dashboard
- [Replays & the session player](/docs/replays)
- [Errors](/docs/errors)
- [Frustration signals](/docs/frustration)
- [Funnels](/docs/funnels)
- [Releases](/docs/releases)
- [Logs & network requests](/docs/logs)
- [Visitors](/docs/visitors)
- [Heatmaps](/docs/heatmaps)
- [Click map](/docs/click-map)
- [Cohort retention](/docs/cohorts)
- [Projects & project keys](/docs/projects)
- [Alerts](/docs/alerts)
- [Shared links](/docs/shared-links)

Integrations
- [Integrations](/docs/integrations)
- [MCP server](/docs/mcp-server)

Account & data
- [Billing & plans](/docs/billing)
- [Security & masking](/docs/security-masking)
- [Data retention & limits](/docs/retention-limits)
- [Team accounts](/docs/team-accounts)

# Installation

Add ReplayPilot to your site with one script tag, no SDK or build step.

## What you're installing

There's no SDK, no npm package, and no build step. You paste one script tag into your site's HTML, and ReplayPilot starts recording sessions. That's the whole install.

ReplayPilot is AI-native from the moment a session lands. Every recording gets an automatic AI summary. The replays search bar takes plain-English queries instead of exact keywords, and a dashboard assistant answers questions about your data. None of it needs separate setup. See [Replays](/docs/replays) once you're recording.

Signing up for the first time? The onboarding wizard covers this in five steps: create your account, tell us about you, add the snippet, invite your team, done. This page covers the "add the snippet" step in more detail. It works the same way when you add ReplayPilot to a new project later.

## Add the script tag

Copy this tag and paste it right before the closing </body> tag on every page you want to record:

html<script src="https://replaypilot.com/snippet.js" data-project="pk_live_xxxxxxxx" async></script>

Replace pk_live_xxxxxxxx with your project's actual key: you'll find it on your project's Keys tab, and it's also shown to you during onboarding. Recording starts automatically as soon as the script loads. You don't need to call any function to turn it on.

The recorder finalizes a session after 20 seconds without meaningful visitor activity. If the visitor becomes active later, it starts a fresh session and full-page snapshot. You can also configure project-specific collection exclusions from the project's **Ignored Paths** tab.

## Installing in Next.js

Use next/script instead of a raw <script> tag, so Next.js manages loading it for you. Add it once in your root layout, not on every page:

tsx// app/layout.tsx
import Script from "next/script";

export default function RootLayout({ children }: { children: React.ReactNode }) {
return (
<html lang="en">
<body>
{children}
<Script
src="https://replaypilot.com/snippet.js"
data-project="pk_live_xxxxxxxx"
strategy="afterInteractive"
/>
</body>
</html>
);
}

strategy="afterInteractive" loads the snippet right after your page becomes interactive, the same recommendation Next.js gives for analytics scripts. Any extra attribute from the plain-HTML version (data-require-consent, for example) passes straight through as a prop on Script, the same as it would in the raw tag.

## Installing in TanStack Start

Use the route's head() option instead of writing a <script> tag by hand: TanStack Router injects a scripts array into the document for you, the same way it handles meta and links. Add it to your root route (src/routes/__root.tsx) so it loads on every page:

tsx// src/routes/__root.tsx
export const Route = createRootRoute({
head: () => ({
scripts: [
{
src: "https://replaypilot.com/snippet.js",
"data-project": "pk_live_xxxxxxxx",
async: true,
},
],
}),
});

Only want it on some routes? Add the same scripts entry to that route's own head() instead of the root's: it doesn't have to be site-wide.

## What the project key is (and isn't)

The data-project value is your **project key**, a code in the format pk_live_<random characters> that tells ReplayPilot which project a session belongs to.

It's safe to put this key directly in your page's HTML, where anyone can see it. It's a public key, the same trust model as a Stripe publishable key. It identifies your project. On its own it doesn't let anyone read your data or take any action on your account.

If a key ever leaks somewhere you didn't intend, you can rotate it any time from the project's Keys tab. The moment you rotate, the old key stops working and the new one takes over, with no downtime.

## Confirm it's working

After you've added the tag, visit your own site once to trigger a session. Then go back to the onboarding screen (or your project's dashboard) and check for events. Once ReplayPilot has received a session, you'll see:

We saw a session come in: you're live.

If you don't see it yet, check two things: that the script tag reached the rendered page (view source, not your editor), and that your project key is correct.

## Optional: gate recording behind consent

By default, recording starts the moment the script loads. If your site needs to wait for cookie consent or another form of permission first, add data-require-consent="true" to the script tag:

html<script
src="https://replaypilot.com/snippet.js"
data-project="pk_live_xxxxxxxx"
data-require-consent="true"
async
></script>

With this set, ReplayPilot won't record anything until your own code calls:

html<script>
window.ReplayPilot.grantConsent();
</script>

Call it once you've collected whatever consent your site requires, for example after a visitor accepts a cookie banner.

### Turnkey banner, if you don't already have one

Building that banner yourself is extra work most sites don't want just to turn on recording. If you don't already show a consent banner and don't want to build one, add this script tag after the snippet tag above. It shows a bottom banner with Accept/Decline, calls grantConsent() for you on Accept, and remembers the visitor's choice:

html<script src="https://replaypilot.com/consent-banner.js" async></script>

It's a plain script with no framework and no dependencies, so it works on any site regardless of your stack. Override the message and button labels with the data-message, data-accept-label, and data-decline-label attributes if the defaults don't fit your tone. The banner is optional. It only does anything on pages where you've also set data-require-consent="true" on the snippet tag. If you're already recording without consent gating, or you already have your own banner calling grantConsent(), skip it.

## What gets masked automatically

ReplayPilot masks every input on the page by default, so passwords and other typed values aren't recorded as plain text. You don't need to configure anything for this. See [Security & masking](/docs/security-masking) for the full picture, including how to mask specific elements yourself.

## Tracking custom events

The snippet also exposes two functions on window.ReplayPilot for your own code to call:

- window.ReplayPilot.track(eventName, props): record a custom event, with any extra details you want attached.

- window.ReplayPilot.identify(userId, traits): tell ReplayPilot who a visitor is once they log in, so ReplayPilot ties their sessions to a real user instead of an anonymous one.

These power the [Visitors](/docs/visitors) and [Funnels](/docs/funnels) pages, but they're optional: the snippet records sessions perfectly well without them.

[What's new →](/docs/whats-new)