Skip to content

Custom User Identification


By default, the SDK automatically generates a unique identification ID for the user. This ID does not carry any identifying attributes and can only distinguish different user attributes. For this purpose, we provide additional APIs to add different identifying attributes to the current user.

Attribute Type Description
user.id string User ID
user.name string User nickname or username
user.email string User email

Note: The following attributes are optional, but it is recommended to provide at least one of them.

Add User Identification

Download File and include it locally.

const { datafluxRum } = require('./lib/dataflux-rum-miniapp.js')
datafluxRum.setUser({
    id: '1234',
    name: 'John Doe',
    email: 'john@doe.com',
})

Import

import { datafluxRum } from '@truewatchtech/browser-rum'
datafluxRum.setUser({
    id: '1234',
    name: 'John Doe',
    email: 'john@doe.com',
})

Remove User Identification

Download File and include it locally.

const { datafluxRum } = require('./lib/dataflux-rum-miniapp.js')
datafluxRum.removeUser()

Import

import { datafluxRum } from '@truewatchtech/browser-rum'
datafluxRum.removeUser()