How It Works
- You pass the user’s attributes — on the
<script>tag, or with theupdatecommand - The widget stores them in
window.ArgideSettingsand sends them to Argide - Every conversation from that browser is labelled with the user’s name
Multi-Page Sites
Add the attributes to your embed script. Every full page load re-sends the identity, so no JavaScript is needed.
Render the values server-side from your session. Leave the attributes off for signed-out visitors — the widget still works, the conversation is just anonymous.
The Settings Object
If you know the user before the widget loads, declarewindow.ArgideSettings before the script tag. It seeds the same attributes at boot, and takes precedence over the data-* attributes:
window.ArgideSettings always holds the current attributes. The update command merges into it.
Single-Page Apps
A single-page app has no full page loads, so the script tag can’t carry an identity that changes after login. Use theupdate command instead.
The update Command
window.argide('update', { ... }) changes the user’s attributes at any time after the widget loads.
The property is
user_id with an underscore — it matches the data-user-id attribute.update merges. A property you pass replaces its current value, and a property you leave out keeps its current value. A partial update doesn’t wipe attributes you set earlier:
Custom Attributes
Any property other thanuser_id, name, email, and visibility is stored as a custom attribute and shown on the conversation in Activity:
{ plan: 'pro' } later updates plan and leaves seats alone.
Custom attributes work with
window.ArgideSettings and the update command only. The data-* attributes carry just user_id, name, email, and visibility.Verified vs Unverified
There are two kinds of identity, and the same user can have both:
If you want the agent to take actions on the user’s behalf against your API, use Identity Verification.
A verified user keeps the Verified badge — an
update can never take it away. The attributes themselves are still overwritable, so don’t treat a verified name or email as tamper-proof.
Handle Logout
Clear the identity when the user signs out, so the next person on the same browser starts fresh:window.argide('resetUser') still works as an alias for resetAndPreserveSession, but it is deprecated and logs a console warning. Use the two commands above.Next Steps
Visibility
Show the widget only to signed-in users
Identity Verification
Let the agent act on the user’s behalf
