Identify users
Use window.uj.identify(...) to tell UserJot who the current signed-in user is.
Once a user is identified, the widget can personalize the experience and keep
feedback activity tied to the right person.
Basic identification
Call identify() after your product knows who the current user is:
window.uj.identify({
id: 'user_123',
email: 'john@example.com',
firstName: 'John',
lastName: 'Doe',
avatar: 'https://example.com/avatar.jpg'
});The id field is required. Everything else is optional, but email is usually
worth including.
Use your own application's user ID here. It should be the stable identifier you assign to that user in your system, not a session ID, not a temporary token, and not a value that changes across logins.
When to call identify()
In most apps, you should identify the user when:
- the user logs in
- the app restores an existing authenticated session
- the user profile changes and you want UserJot to reflect the updated data
If the user logs out, clear the identity:
window.uj.identify(null);What identification affects
Once a user is identified, UserJot can:
- associate feedback activity with that user
- show a more consistent signed-in experience in the widget
- carry identity into automatic login flows on public UserJot surfaces when automatic login is enabled
Identification is the client-side step. If you also want trusted cross-surface authentication, use the Automatic login docs.
Secure identification
If your automatic login setup requires signed tokens, include a server-generated
signature in the payload:
window.uj.identify({
id: 'user_123',
email: 'john@example.com',
signature: 'SERVER_GENERATED_SIGNATURE'
});The signature should be created on your server, not in the browser.
Adding traits
You can send traits along with the identified user when you already know useful account context in your app.
window.uj.identify({
id: 'user_123',
email: 'john@example.com',
traits: {
plan: 'pro',
companySize: 42,
trialing: false
}
});If you want to update one trait after identification, use setTrait(...):
window.uj.setTrait('plan', 'enterprise');
window.uj.setTrait('trialing', false);Adding company data
If your product is account-based or B2B, you can also attach company information with the current user:
window.uj.identify({
id: 'user_123',
email: 'john@example.com',
companies: [
{
id: 'company_456',
name: 'Acme Inc.',
domain: 'acme.com',
logo: 'https://example.com/acme-logo.png',
traits: {
plan: 'enterprise',
industry: 'Software',
companySize: 250
}
}
]
});You do not need to send company data unless it is useful to your setup.
Common app pattern
This is the usual pattern in a client app:
if (user) {
window.uj.identify({
id: user.id,
email: user.email,
firstName: user.firstName,
lastName: user.lastName,
avatar: user.avatarUrl,
signature: user.userJotSignature
});
} else {
window.uj.identify(null);
}Anonymous users
The widget can still work without identify(), but the experience is less
connected to your product account state.
For authenticated products, identifying users is usually the better default because it reduces friction and makes UserJot activity easier to understand.
Practical guidance
- Use stable IDs from your own system
- Identify the user only after your app session is ready
- Clear identification on logout
- Only send fields you actually need
- Keep signing logic on the server when secure mode is enabled