User identification

Track which users are affected by errors.

Overview

User identification lets you see which users are affected by

each error, helping you prioritize fixes based on real impact.

Privacy-first design

Trovi never stores PII. All user IDs are one-way hashed

before storage. You can safely pass any identifier — database

ID, session token, username — and Trovi will hash it to an

anonymous string.

Setup

Identify on login

import { identifyUser } from '@trovi/sdk/browser'

identifyUser(session.user.id)

Set at init time

init({
  apiKey:       'your-key',
  dashboardUrl: 'https://...',
  userId:       currentUser.id,
})

Clear on logout

import { clearUser } from '@trovi/sdk/browser'
clearUser()

Anonymous users

If you don't call identifyUser(), Trovi automatically

assigns a random anonymous ID stored in localStorage.

Anonymous IDs start with anon_. Identified user IDs

start with uid_.

What you see in the dashboard

  • Impact score on each ticket
  • Affected users and counts per issue
  • User explorer with aggregate error history
  • User detail views with ticket and event patterns

Node.js

import { captureEvent } from '@trovi/sdk/node'

captureEvent({
  type:     'js_error',
  severity: 'error',
  message:  err.message,
  metadata: {
    userId: req.user?.id,
    path: '/api/orders',
  }
})