@amplitude/plugin-session-replay-browser
Official Browser SDK plugin for session replay
Installation
This package is published on NPM registry and is available to be installed using npm and yarn.
npm install @amplitude/plugin-session-replay-browser
yarn add @amplitude/plugin-session-replay-browser
Usage
This plugin works on top of Amplitude Browser SDK and adds session replay features to built-in features. To use this plugin, you need to install @amplitude/analytics-browser
version v1.0.0
or later.
1. Import Amplitude packages
@amplitude/analytics-browser
@amplitude/plugin-session-replay-browser
import * as amplitude from '@amplitude/analytics-browser';
import { sessionReplayPlugin } from '@amplitude/plugin-session-replay-browser';
2. Instantiate session replay plugin and install plugin to Amplitude SDK
The plugin must be registered with the amplitude instance via the following code:
amplitude.init(API_KEY);
const sessionReplayTracking = sessionReplayPlugin();
amplitude.add(sessionReplayTracking);