Skip to main content
This guide covers how to install Userplane in an Angular application.

Adding the script

The fastest way to add Userplane is the CDN embed. Add these two tags to the <head> of src/index.html:
You can copy the snippet with your workspace ID pre-filled from Workspace Settings > Domains in the Userplane dashboard.

npm SDK

Use the npm SDK when you need programmatic control — triggering recordings from a button, attaching user metadata, or reading recording state.

Installation

Initialization

Create an initializer factory and register it with APP_INITIALIZER in your app config. Angular calls APP_INITIALIZER providers during bootstrap, before the first component renders.
Store the workspace ID in your environment file:
Angular CLI replaces environment.ts with environment.prod.ts for production builds automatically.

URL parameters

When a customer opens a recording link, Userplane appends userplane-token and userplane-action to the URL. If your app uses route guards that redirect unauthenticated users, preserve the userplane- prefixed parameters through the redirect:
See Installation for the full list of parameters.

Sensitive data

Add data-userplane-blur to any element you want blurred in recordings. See Sensitive Data Redaction for the full reference.

Metadata

Call set() inside the initializer factory after initialize():
See Metadata SDK for the full API.

Example app

A complete Angular example is available at github.com/userplanehq/userplane-sdk-examples/tree/main/examples/angular.

Example app