Docs

Identifying Users

Link conversations to your users and provide context to your support team.

When users are identified, their information appears in your Heyo dashboard, making it easier for your support team to provide personalized help.

Why identify users?

  • See who you're talking to - Names and emails appear in the Dashboard
  • Track user history - All conversations are linked to the same user
  • Provide better support - Your team has context about the user

Basic identification

Call identify() with the user's information (works with both HTML script and JS SDK):

userId
string required
Your internal user ID. Must be unique per user.
email
string
User's email address.
name
string
User's display name.
HEYO.identify({
    email: '[email protected]',
    name: 'John Doe',
    userId: '12345',
});

What can you send?

The main identification fields are:

HEYO.identify({
    email: '[email protected]',
    name: 'Sarah Wilson',
    userId: 'user_789',
});
Looking for more customization? Check out Tags and Custom Fields to learn how to add metadata like user plan, subscription status, and custom properties.

Real-World Examples

After user logs in:

// When your authentication completes
auth.onLogin((user) => {
    HEYO.identify({
        email: user.email,
        name: user.displayName,
        userId: user.id,
    });
});
Privacy Note: Only userId is required to actually identify users. You can pass any internal ID you want, as long as it's unique per user.

Identity Changes

When you call HEYO.identify() with a different userId or email than the currently identified user, Heyo will automatically:

  1. Clear the current session
  2. Reset the conversation state
  3. Start a fresh session for the new user

This prevents conversations from being merged, for example when you need to impersonate users for debugging.

Manual Logout

If you need to explicitly clear the current session (for example, when a user logs out), you can use the logout() method:

HEYO.logout();

This will clear the session cookies and reset the widget state.