How to Identify Users with the Events API

When customers start a chat, you see "Guest" by default. Use the Events API to show their real name and contact info so your team can provide better support.

Image: Contact showing name and email in TidySupport inbox
1

Find your workspace ID

Go to your TidySupport dashboard and navigate to Settings → Widget. Copy your workspace ID.

2

Add the config script before the widget

Add this snippet before the TidySupport widget script. Replace the template variables with actual values from your backend or session.

HTML
<script>
  window.TidySupportConfig = {
    userId: "{{ current_user.id }}",
    email: "{{ current_user.email }}",
    name: "{{ current_user.name }}",
    // Optional custom attributes:
    plan: "{{ current_user.plan }}",
    company: "{{ current_user.company }}"
  };
</script>

The userId, email, and name fields are the most useful. Custom attributes like plan and company are optional and appear in the contact sidebar.

Image: Config script placed before the widget script tag
3

Replace template variables with real values

The syntax above uses generic template placeholders. Replace them with the actual values your backend or framework provides. For example, in a Next.js app you might pass them as props from a server component or read them from a session cookie.

4

Verify

Start a chat on your site while logged in as a test user. Open your TidySupport inbox and check that the new conversation shows the contact's name and email instead of "Guest".

Image: Conversation in TidySupport inbox showing identified user

Only set TidySupportConfig for logged-in users

Wrap the config block in a conditional check so it only runs when a user is authenticated. Anonymous visitors will still be able to chat — they will just appear as "Guest" until they provide their details.