Npm Setup Guide
This guide walks you through setting up the PlayerZero SDK using npm to start monitoring and improving your frontend applications.
Prerequisites
- Node.js and npm or yarn installed.
- Access to your project’s frontend codebase.
- Your PlayerZero Project ID.
Step-by-Step Instructions
1. Install the SDK
2. Initialize the SDK
Insert this early in your application’s entry point (e.g., index.js, main.ts, App.vue, etc.):
Important: PlayerZero.init should only be called once. Use PlayerZero.isInitialized() to check if initialization has occurred.
3. Identify the User (Recommended)
Once the user is authenticated or known:
Next Steps
Once the SDK is installed and initialized, you can visit the Users page in PlayerZero to see live user sessions being captured.
If you want to control where PlayerZero is active, visit the Domain Settings guide to configure domain-level access and environment-specific behavior.
Want to extend your integration further? Explore the Advanced SDK Usage guide to unlock features like custom event tracking, devtools links, and user metadata enhancements.
Was this page helpful?