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.
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 declarewindow.ArgideSettings before the snippet. It accepts the same attributes plus custom attributes, and its values take precedence over the data-* attributes.
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. Callupdate after sign-in instead:
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.update merges. A property you pass replaces its current value, and a property you leave out keeps its value:
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 thanuser_id, name, email, and visibility is stored as a custom attribute. Custom attributes are listed under Custom attributes on the conversation’s Details tab.
{ 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.
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, fromdata-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
CallresetAndClearSession 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

