Back to Documentation
Getting Started

Installation Guide

Get up and running with Rewatched in under 5 minutes

1. Create an Account

First, sign up for a Rewatched account. You'll get immediate access to the dashboard and can start tracking your application right away.

Sign up for free

2. Create Your First Application

After signing up, navigate to the Domains page and create your first application:

  1. Go to Domains & Apps in the sidebar
  2. Click Add Application
  3. Enter your application name and URL
  4. Click Create

You'll receive a unique SDK key for your application.

3. Install the SDK

Add the Rewatched snippet to your application. You can install via npm or use our CDN.

Option A: NPM Installation

bash
npm install @rewatched/analytics
# or
yarn add @rewatched/analytics

Option B: CDN Script Tag

html
<script>
  !function(w,d,s){
    var r=w.rewatched=w.rewatched||[];
    if(!r.init){
      r.init=function(){r.push(arguments)};
      var script=d.createElement(s);
      script.async=1;
      script.src='https://cdn.rewatched.io/sdk/v1/analytics.js';
      d.head.appendChild(script);
    }
  }(window,document,'script');

  rewatched.init('YOUR_SDK_KEY', {
    apiHost: 'https://api.rewatched.io',
    autocapture: true
  });
</script>

4. Initialize the SDK

Configure the SDK with your API key and options:

import rewatched from '@rewatched/analytics';

rewatched.init('YOUR_SDK_KEY', {
  apiHost: 'https://api.rewatched.io',
  autocapture: true,           // Automatic event tracking
  persistence: 'localStorage',  // Cookie or localStorage
  sessionRecording: true,       // Enable session replay
  capturePageviews: true       // Track page views
});

Important: Replace YOUR_SDK_KEY with the actual SDK key from your application settings.

5. Verify Installation

After installing the SDK, verify that events are being tracked:

  1. Visit your application in a browser
  2. Perform some actions (clicks, page views)
  3. Go to your Rewatched dashboard
  4. Navigate to Analytics
  5. You should see events appearing within a few seconds

Success! If you see events in your dashboard, you're all set. If not, check the browser console for errors.

Next Steps

Track Custom Events

Learn how to track custom events beyond auto-capture

Read guide →

Create Features

Tag UI elements to track feature usage

Read guide →

Visual Designer

Create in-app guides without code

Read guide →

React Integration

React-specific hooks and components

Read guide →

Troubleshooting

Events not appearing in dashboard

  • Check that you're using the correct SDK key
  • Verify the application URL is whitelisted in your app settings
  • Look for errors in the browser console
  • Ensure the SDK script is loading (check Network tab)

CORS errors

  • Add your domain to the whitelist in application settings
  • For localhost development, ensure "Allow localhost" is enabled