Web SDK Integration
The latest version of the Web SDK: 3.0
Please see the changelog if you are using an outdated version.
Integration
Installation via NPM package
npm install @dev-2-dev/websdkCDN installation
To integrate SDK, add the following line to the tag of your page:
<script src="https://cdn.devtodev.com/sdk/web/v3/devtodevsdk.js"></script>The SDK will be available globally as window.devtodev.
Initialization
Add the application to the Space using the wizard for adding applications.
In order for SDK for WEB to start working, it is necessary to perform initialization right after the page is loaded and you have a basic user identifier at your disposal.
Using NPM package
import DTDAnalytics from '@dev-2-dev/websdk';
// Create an instance
const analytics = new DTDAnalytics();
// Initialize with your app ID
analytics.initialize('App ID', config);Using CDN
You can find the App ID in the settings of the respective app in devtodev (Settings → SDK → Integration → Credentials).
For Cross-platform type projects use App ID + Platform ID .
config – is an object that is used for specifying additional properties during initialization.
Config
userId
string
Unique user identifier. For example, user’s ID in a social network, or a unique account name used for user identification on your server. If at the time of initialization this identifier is not yet available, specify the identifier later using
the setUserId method.
currentLevel
integer
The player level at the moment of devtodev SDK initialization. Must be greater than 0. It’s optional but we recommend using it for improving data accuracy.
trackingAvailability
boolean
The property allows or disallows devtodev tracking of the user. By default, it is set to true. SDK stores the previously assigned value. Pass false if the user opted out of tracking in line with GDPR.
logLevel
string
The level of logging the SDK activity. The "No" value is used by default. For troubleshooting during integration, it is recommended to set it to "Debug", and either switch it "No" or use it only for error handling "Error" in the release version.
applicationVersion
String
The app version. Cannot be empty.
Example:
Session recording
A powerful session recording plugin that automatically captures user interactions on your website using advanced screen recording technology. This plugin integrates seamlessly with the DevToDev WebSDK to provide comprehensive session replay capabilities.
Session replaysInstallation
NPM
Yarn
Enabling the plugin
NPM
CDN
Disabling from SDK Config
You can disable session recording through the SDK's webSessions configuration:
Session recording configuration
Recording Options (Constructor Config)
Configure privacy and recording behavior when creating the tracker instance:
Configuration Options
These options are passed to the DTDWebSessionTracker constructor:
recordCanvas
boolean
true
Record canvas elements
maskAllInputs
boolean
false
Mask all input fields
maskInputOptions
object
See below
Selective input masking options
blockClass
string
'sensitive-field'
CSS class name to block elements from recording
Mask Input Options:
password
boolean
true
Always mask password fields
email
boolean
true
Mask email fields
text
boolean
false
Mask text inputs
Privacy configuration examples
Mask all inputs:
Selective masking:
Block specific elements. Add the
'sensitive-field'class to exclude elements from recording:
Last updated
Was this helpful?
