RUM SDK supports multiple integration methods. Choose the one that best fits your project requirements.
Integration Methods
We provide three integration methods:Integration Code
- NPM Package
- CDN Async
- CDN Sync
Add Then initialize in your app entry file:
@flashcatcloud/browser-rum to your package.json:Initialization Parameters
Required Parameters
string
required
Application ID, obtained from the application management page
string
required
Client Token, obtained from the application management page
string
required
Service name, used to distinguish different services
Optional Parameters
string
Environment identifier, such as
production, staging, etc.string
Application version number
number
default:"100"
Percentage of sessions to track: 100 for all, 0 for none
number
default:"0"
Percentage of sessions with Session Replay enabled
'granted' | 'not-granted'
default:"granted"
Initial user tracking consent state, see User Tracking Consent
boolean
default:"false"
Whether to manually control view creation, see Override Default View Names
boolean
default:"true"
Whether to automatically collect user interactions
boolean
default:"true"
Whether to enable resource event collection
boolean
default:"true"
Whether to enable long task event collection
boolean
default:"true"
Whether to enable cross-session anonymous user ID collection
'allow' | 'mask-user-input' | 'mask'
default:"mask-user-input"
Session replay privacy policy:
allow collects all data except passwords, mask-user-input hides user input field content, and mask hides all textarray
List of request URLs for injecting tracing headers, see Integrate RUM with Distributed Tracing
number
default:"100"
Percentage of requests to trace
string
Optional proxy URL, e.g.,
https://www.proxy.com/pathboolean
default:"false"
Whether to compress requests sent to Flashduty, done in Worker thread
boolean
default:"false"
Whether to store context in localStorage for cross-page persistence
Use Cases
Custom User Identification
UseflashcatRum.setUser() to add identification attributes for the current user:
Adding Custom Tags
After initializing RUM, use thesetGlobalContextProperty API to add additional tags to all RUM events:
Sending Custom Actions
Use theaddAction API to create RUM actions with context attributes:
Custom Error Reporting
You can attach local context to error objects via thedd_context property:
Verification
1
Check Network Requests
Open browser developer tools and check if there are data upload requests to
https://browser.flashcat.cloud/api/v2/rum in the Network panel.2
View Console Data
Access the Flashduty console to verify that RUM application data is displaying correctly.
3
Trigger User Interactions
Trigger some user interactions on the page (clicks, scrolls, etc.) to verify data collection is working.
Data typically appears in the console within 2-5 minutes.
Next Steps
Advanced Configuration
Learn about advanced SDK configuration features
Data Collection
Learn about data types collected by the SDK
Insights
View and analyze RUM data