Help center / Guide

Add the customer messenger

A native custom element, with identity issued by your server.

Build the web components

HQ.support ships stx sources for its messenger, launcher, help search, ticket form, and ticket status. Run the native build with bun scripts/build-support-elements.ts. The generated module is served at /widgets/bundle.js.

Boot a customer session

Your server creates a short lived session with the server SDK. Pass only that session token and the public project ID into the browser. Keep API keys on your server.

<script type="module" src="https://hq.support/widgets/bundle.js"></script>
<hq-support-messenger project-id="YOUR_PUBLIC_PROJECT_ID">
</hq-support-messenger>

Call the element's boot({ url, project, token }) method to connect a verified identity, then open() to show it. Use shutdown() when the customer signs out. Anonymous sessions require an allowed origin on the project.

Follow delivery state

The messenger emits ready, opened, closed, unread, delivery, and error events. A delivery event confirms that the customer API accepted the message. An error leaves the draft available for retry.

Match your host

Elements render inside isolated shadow roots. The messenger accepts the CSS custom property --support-accent. Test your host's content security policy and allowed origins before rollout.