Skip to main content
The HelpAlive JavaScript SDK reference lists the script tag’s attributes and each call on the HelpAlive object. The calls are identify(), reset(), setConsent(), track(), flush(), shutdown() and init(). Most apps need only the tag, identify() and reset(), as Install the script shows.

Prerequisites

  • The HelpAlive tag is in your pages.
  • The four queue lines from Install the script run before your first call.

Script tag attributes

identify()

  • The script refuses a call only in these cases:
    • Neither userId nor userToken names the user.
    • userId or tenantId is over 255 characters, or is neither text nor a number.
    • An id in userToken is over 200 characters.
  • If another required field is missing, the call goes on, and your dashboard has less to show.
  • A number in displayName, role or plan is turned into text.
  • A field of the wrong type, or too long, is left out and the call goes on. With data-debug on the tag, the console says which field.
  • Returns a promise that resolves once the call is handled. Calls run in the order you make them.
  • Calling it again for the same user is safe. Calling it for a different user closes the previous user’s agent first.
Identify users explains each field.

reset()

Forgets the signed-in user, their tenant, their token and their session. Closes the agent and clears its conversation from the browser. Other tabs of your app in the same browser are signed out of HelpAlive too. Call it in your logout code, apart from identify(). Activity after reset() waits in the page until the next identify().

setConsent()

Does nothing, and you never need to call it. It stays in the queue lines only so pages that already call it keep working.

track()

Records an event of your own with the signed-in user’s activity.
Events tracked before identify() wait in the page until it runs. Custom properties are stored as you send them, so don’t put personal data in them.

flush()

Sends any recorded activity now. You rarely need it, because HelpAlive sends activity in batches, and when the page is hidden or closed.

shutdown()

Stops recording on this page and removes HelpAlive’s listeners. Calls after it do nothing until init() runs again. It doesn’t close an open agent. To close it, call reset() before shutdown().

init()

Most apps never call init(), because the tag’s data-api-key starts HelpAlive. Call it only if you load the script without data-api-key, once the script has loaded. Never do both, or HelpAlive starts twice.
Set a key to false to turn that kind of recording off, for example capture: { changes: false }: The agent uses recent activity to understand what the user just did. Turning kinds off makes its help fit less well. init() returns a promise, and rejects if apiKey is missing.

Check it works

In the browser console on a signed-in page, run typeof HelpAlive.init:
  • "function" means our script has loaded.
  • "undefined" means only the queue lines have run.
Add data-debug to the tag. The browser console then shows what HelpAlive does, and why it refuses a call.

Why is HelpAlive not defined?

A call ran before the queue lines. Put the four queue lines above your first call.

Why does a call do nothing?

Either the tag has no data-api-key, or identify() was refused. Add data-debug to the tag and read the console. Troubleshooting lists each cause.

Next

Install the script

The tag, identify() and reset().

Identify users

Every field, in detail.

Troubleshooting

When the agent doesn’t appear.
Last modified on November 25, 2026