Adding the script
The fastest way to add Userplane is the CDN embed. Add these two tags to the<head> in your root route’s <Head> component:
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 aUserplaneProvider component and render it inside your root route component. Use useEffect with a dynamic import() to ensure initialization runs only in the browser.
URL parameters
Add the Userplane params to your root route’s search param schema:z.record(z.string()) for a more permissive catch-all if your app accepts arbitrary query parameters.
If your app redirects unauthenticated users to a login page, preserve the 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() inside the useEffect after initialize():
SSR
TanStack Start renders on the server before hydrating in the browser.@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, which useEffect guarantees.
Example app
A complete TanStack Start example is available at github.com/userplanehq/userplane-sdk-examples/tree/main/examples/tanstack-start.
Example app
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.