Identify users
By default, Databuddy tracks visitors with an anonymous device ID. Calling identify() links that activity to a user ID from your own system, so the same person is recognized across sessions and devices, and your dashboard shows real names and emails instead of anonymous visitors.
Quick start
How it works
Traits
Traits are flat key/value metadata about the user. Values must be strings, numbers, booleans, or null. Nested objects are rejected. Limits: 50 keys, 2KB serialized.
Display names and emails are encrypted at rest (AES-256-GCM). Custom traits are stored as regular values so you can filter and segment by them.
Update traits by calling identify() again with the same ID, and remove one by setting it to null. With the React provider, change the user's traits instead.
import { identify } from "@databuddy/sdk";
identify(user.id, { plan: "enterprise", trial_ends_at: null });Accounts from email domains
Users identified with an email are grouped by their work email domain on the Accounts page, with no other setup. Everyone signing in with an @acme.com address becomes one account, with the company's public name, logo and industry when they can be looked up. Personal addresses (Gmail, Outlook and the like) and your own team's domain are left out.
To group users by your own workspaces or organizations instead, with plan and billing, see Accounts.
Revenue attribution
If you use the Stripe or Paddle integration, include the user ID in your payment metadata and transactions are attributed to the identified user:
API reference
identify(profileId, traits?)
Links the browser to a user ID. Persists across sessions, attaches to every subsequent event. Safe to call on every page load: repeat calls with the same ID and no traits send one request per session. Calling it again with traits merges them into the profile.
reset()
Forgets the identified user and starts new anonymous and session IDs, so subsequent activity is tracked anonymously as a new visitor. Call it on logout.
getIds()
Returns { anonymousId, sessionId, profileId }. profileId is the currently identified user ID, or null when anonymous.
How is this guide?