Widget JavaScript API
The Woes loader exposes a queued browser API atwindow.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 beforehttps://woes.dev/widget.js has loaded, create the command queue first.
Common Commands
Identify A Customer
Useidentify when your application knows who the visitor is.
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, whenwidget.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.
{ 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.
identify before widget.js finishes loading,
create the queued API first.
Prefill Conversation Metadata
Use metadata fields to help operators understand the customer’s current page or workflow.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-storeand no private secret. - Send a test message.
- Confirm the conversation appears in Woes Inbox.
- Confirm verified users appear with email/name and
identity_sourceofwidget-token. - Confirm identity and metadata are shown only as intended.
