This guide covers how to install Userplane in a Remix application.Documentation Index
Fetch the complete documentation index at: https://docs.userplane.io/llms.txt
Use this file to discover all available pages before exploring further.
Adding the script
The fastest way to add Userplane is the CDN embed. Remix controls the full HTML document through the root route, so add these two tags to the<head> in app/root.tsx:
YOUR_WORKSPACE_ID with your workspace ID. You can copy the snippet with your 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 a provider component that initializes the SDK and mount it in your root route.Remix does not use
NEXT_PUBLIC_ or VITE_ prefixes for client-side environment variables.
Instead, server-side env vars are passed to the client through a root loader that serializes them
to window.ENV. The dangerouslySetInnerHTML script block above is the standard Remix pattern
for this.URL parameters
Remix loaders may redirect users before the SDK reads theuserplane-token and userplane-action query parameters. If your app redirects unauthenticated users to a login page, preserve userplane- prefixed parameters through the redirect:
Sensitive data
Adddata-userplane-blur to any element you want blurred in recordings. See Sensitive Data Redaction for the full reference.
Metadata
Callset() after initialize() to attach user context to recordings:
SSR
@userplane/sdk is SSR-safe to import — it does not reference window or document at module evaluation time. The initialize() call must run client-side. Calling it inside useEffect guarantees it runs only in the browser.
| Concern | Safe? | Notes |
|---|---|---|
Static import at top of a component file | Yes | Module is SSR-safe |
Calling initialize() in useEffect | Yes | Runs browser-only |
Dynamic import('@userplane/sdk') in useEffect | Yes | Bundle-size optimization only |
Calling initialize() in a loader | No | Loaders run on the server |
Example app
A complete Remix example is available at github.com/userplanehq/userplane-sdk-examples/tree/main/examples/remix.| Variable | Description |
|---|---|
USERPLANE_WORKSPACE_ID | Your Userplane workspace ID |
Related articles
- Installation — CDN script placement, CSP, and redirect handling.
- Web SDK — full SDK API reference.
- Metadata SDK — attach user context to recordings.
- Sensitive Data Redaction — blur sensitive content in recordings.