JavaScript API
Open the help center
Txt.openHelpCenter() opens the AI component on its help center. Use it to wire your own buttons and links to the help center.
You can call it on any page that loads the Unless script. If the AI component is not loaded yet, it is loaded and shown for you - you do not need to call Txt.openChat() first. Calling it while the help center is already open navigates to the requested view instead of closing the component.
Open the help center index
Section titled “Open the help center index”Opens the categories grid.
Txt.openHelpCenter()Open a category
Section titled “Open a category”Opens that category’s article list.
Txt.openHelpCenter({ categorySlug: "billing" })Open an article
Section titled “Open an article”Opens the article for a question. Pass categorySlug and faqId when you know them so the article opens without having to resolve them first.
Txt.openHelpCenter({ categorySlug: "billing", question: "How do I update my payment method?", faqId: "f1b2c3d4",})Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
categorySlug | string (optional) | The slug of the category to open. On its own, opens that category’s article list. |
question | string (optional) | The question of the article to open. Opens the help center directly on that article. |
faqId | string (optional) | The id of the FAQ the question belongs to. Optional, and only useful together with question. |
Return value
Section titled “Return value”The function returns a promise that resolves once the component is showing its help center, so you can chain on it. A categorySlug or a question is applied right after that, as the category and the article load - the promise does not wait for them.
Txt.openHelpCenter({ categorySlug: "billing" }) .then(() => console.log("the help center is showing")) .catch((error) => console.error(error))The promise rejects if the component never shows the help center, for example when the AI component fails to load or the help center is not enabled on your account. Always attach a .catch() so the rejection does not surface as an unhandled error.
Display behaviour
Section titled “Display behaviour”The component behaves exactly as it does when a visitor opens the help center tab themselves. From a popover or a sidebar it promotes into the conversation center, and an inline component stays inline.