Quickstart

Get RetainPixel running in 5 minutes.

Get RetainPixel Running in 5 Minutes

Follow these steps to install RetainPixel, send your first event, and verify it arrives in your dashboard.

1. Sign up

Create your account at /login. You will receive a magic link via email.

2. Create your org and app

After signing in, the onboarding flow walks you through creating your organization and first app. This generates your API key automatically.

3. Copy your API key

Your live API key is shown once during onboarding. Copy it immediately -- you will not be able to see it again. You can always rotate keys from the API Keys settings page.

4. Install the SDK

Install the browser SDK via npm:

bash
npm install @retainpixel/sdk-browser

5. Initialize in your app entry point

javascript
import { RetainPixel } from '@retainpixel/sdk-browser';

const rp = RetainPixel.init({
  writeKey: 'rpx_live_YOUR_KEY_HERE',
});

6. Identify a user

Call identify after your user logs in to link events to their profile:

javascript
rp.identify('user-123', {
  email: 'user@example.com',
  plan: 'pro',
});

7. Track an event

Track custom events whenever users perform meaningful actions:

javascript
rp.track('feature_used', {
  feature: 'export',
  format: 'csv',
});

8. Verify your install

Open your browser console on any page where the SDK is loaded and paste:

javascript
rp.track('test_event', { source: 'quickstart_verify' });

Then visit your dashboard Events page to see the event arrive. It should appear within a few seconds.

Alternative: Script tag

If you are not using a bundler, you can load the SDK via a script tag:

html
<script src="https://cdn.retainpixel.com/v1/rp.min.js" data-write-key="rpx_live_YOUR_KEY_HERE"></script>

The SDK will initialize automatically and expose window.rp for tracking calls.