Widget JavaScript API
The Woes loader exposes a queued browser API at window.Woes. Calls can be made after the install snippet is present; the loader queues commands until the widget runtime is ready. The embedded iframe also queues early commands until the inner widget API is installed, so early identify calls made during widget boot are not dropped.
Create The Queue Early
If your app may identify a user before https://woes.dev/widget.js has loaded, create the command queue first.
Then load the widget script with your public widget key.
Common Commands
Identify A Customer
Use identify when your application knows who the visitor is.
Unsigned identity is useful for display and routing, but it is not proof of identity. Any browser user can alter unsigned fields. For trusted history or account-specific context, use Widget Identity.
Verified Identity Pattern
For verified installs, your backend should expose an authenticated, no-store endpoint that returns the signed identity proof for the current logged-in user. Fetch it after login/session load, when widget.js loads, on window focus, and when the page becomes visible again.
Calling identify more than once for the same current user is safe. Do not suppress retries for the same HMAC or JWT before Woes has accepted it.
For JWT mode, send { jwt: identity.jwt } instead. See Widget Identity for the server-side HMAC/JWT contract.
For verified installs, call identify with the server-generated HMAC email hash
or JWT before the visitor sends their first message.
If your application may call identify before widget.js finishes loading,
create the queued API first.
Woes verifies HMAC/JWT proofs against the exact widget key installed on the
page. In Settings → Security, select that agent and use Test an identity
proof to confirm the backend output before testing a live chat.
Use metadata fields to help operators understand the customer’s current page or workflow.
Do not send secrets, payment details, access tokens, or private customer data in client-side metadata.
Testing Checklist
- Load the page in a private browser window.
- Run
window.Woes("show") from the browser console.
- If identity is enabled, confirm your identity endpoint returns
Cache-Control: no-store and no private secret.
- Send a test message.
- Confirm the conversation appears in Woes Inbox.
- Confirm verified users appear with email/name and
identity_source of widget-token.
- Confirm identity and metadata are shown only as intended.
Related Pages
Last modified on July 3, 2026