Users

A user is identified by a string userId and connects events to a person.

What is a user

A user in Vanta is identified by a string userId, such as user_123 or an email address. Users appear in the dashboard, where you can view their events and properties. All user data is scoped to a single project, so the same userId in two different projects produces two separate records.

Identifying users

Attach identity data to a user with vanta.identify():

typescript
import { Vanta } from '@vanta-dev/node'

const vanta = new Vanta({
  apiKey: process.env.VANTA_API_KEY,
})

await vanta.identify({
  userId: 'user_123',
  email: 'sarah@example.com',
  name: 'Sarah Chen',
  avatar: 'https://example.com/avatar.png',
  properties: {
    plan: 'pro',
    signupChannel: 'docs',
  },
})

Calling identify() records an $identify internal event and attaches the identity data to the user record.

Anonymous events

An event sent without a userId is anonymous. It still records what happened, but there is no identity attached to it and it does not appear under any user profile. An identified event includes a userId, so it is attributed to a known person.

Many applications start anonymous and connect the anonymous activity to a user the moment the person signs in. Send events without a userId before sign in, then switch to sending the userId after.

Identity and analytics

Identity is what turns raw event streams into answers about people. Pairing user identity with grouping lets you answer questions like “which users did this?” and “which accounts did this?” without stitching together unconnected records.