Skip to main content
By default, every conversation comes from an anonymous visitor. Pass the user’s name, email, and your own user ID, and their conversations are labelled with that name in Conversations. Their attributes appear on the conversation’s Details tab.

Choose how to identify users

There are two kinds of identity. You can send both for the same user. A verified identity needs your Server Side API to use JWT Forward auth. Without it, identify stores nothing. This page covers attributes. For the JWT setup, see Identity verification.
Attributes are taken on trust. Anyone who reads your page source can send any name, email, or user ID. Treat them as labels for your team, never as proof of who someone is.

Multi-page sites

If every page is rendered by your server, add the attributes to the script tag. Each page load sends them again, so you need no JavaScript.
Render the values from your server-side session. Leave the attributes off for signed-out visitors. The widget still works, and the conversation stays anonymous.

The settings object

You can also declare window.ArgideSettings before the snippet. It accepts the same attributes plus custom attributes, and its values take precedence over the data-* attributes.
After Argide loads, window.ArgideSettings always holds the current attributes.

Single-page apps

In a single-page app, the user signs in without a page load, so the script tag can’t carry their identity. Call update after sign-in instead:
If this code can run before Argide has loaded, queue the command instead. Send commands before the widget loads shows a helper that works either way. To show the widget only to signed-in users, add data-visibility="false" to the script tag and pass visibility: true in the same update. See Visibility.

The update command

The property is user_id, with an underscore, to match data-user-id.
An update merges. A property you pass replaces its current value, and a property you leave out keeps its value:
After the second call, the user still has their name and email. If an update fails, the console shows [Argide-B2B] ArgideSettings update failed with the reason. An invalid email is the most common cause.

Custom attributes

Any key other than user_id, name, email, and visibility is stored as a custom attribute. Custom attributes are listed under Custom attributes on the conversation’s Details tab.
Custom attributes merge key by key. Sending { plan: 'pro' } later changes plan and leaves seats alone.
Custom attributes work with window.ArgideSettings and update only. The script tag’s data-* attributes carry just the user ID, name, email, and visibility.

Where identity shows up

  • Conversation list. Conversations show the user’s name instead of Anonymous visitor.
  • Details tab. Open a conversation and select Details to see Name, Email, User ID, any custom attributes, and an identity badge: Anonymous, Unverified, or Verified.
  • Email notifications. When a teammate replies and the user doesn’t see it in the widget, Argide can email them at this address. See Email notifications.
When an anonymous visitor signs in, their session continues, and conversations they already had in it are labelled with their identity. A user who verified with identify keeps the Verified badge. A later update can change their attributes but never removes the badge.

When a different user signs in

Argide notices when a different person signs in on the same browser. It compares the incoming user ID with the last one it saw, from data-user-id, window.ArgideSettings, update, or the subject of an identify JWT. When they differ, Argide starts a new session automatically and clears the previous user’s conversation from the widget. You should still clear the identity on logout, because the next visitor may be anonymous.

Handle logout

Call resetAndClearSession when the user signs out:
Both commands clear user_id, name, email, and custom attributes from window.ArgideSettings, keeping only visibility. Neither deletes anything in the dashboard: past conversations keep the identity they were labelled with. Use resetAndPreserveSession only when the person stays the same but should lose access to your API, for example when their own session expires. For a real logout, use resetAndClearSession.
resetUser still works as an alias for resetAndPreserveSession, but it is deprecated and logs a console warning.

Next steps

Identity verification

Let the agent call your API as the signed-in user

Visibility

Show the widget only to signed-in users