Messenger

The Messenger is a chat box you add to your own website, so visitors can ask questions and be escalated to your team. You add it with one snippet on the Install page, then choose which sites and pages it appears on and how it looks.

On this page

Add the Messenger to your site

Open ConnectInstall and select Set it up, or paste the snippet yourself. The Messenger loads on a page once the snippet is on it.

Once the Messenger has loaded on a site, that site is listed under Sites, with Live on and its host if it was seen in the last 24 hours. Otherwise it reads Not seen today and shows when it was last seen.

Choose how to paste the snippet

The snippet is the same for every framework. Only the place you put it changes: a script tag, Webflow, WordPress, React, Svelte, Vue, or Next.js.

The script tag form is this, with your key in data-api-key:

html

<script>window.CactusMessenger=window.CactusMessenger||Object.assign(function(){(window.CactusMessenger.q=window.CactusMessenger.q||[]).push(arguments)},{q:[]});</script>
<script
  id="cactus-messenger-loader"
  src="https://messenger.heycactus.ai/v1/messenger.js"
  async
  data-cactus-messenger
  data-api-key="YOUR_INSTALL_KEY"
></script>

On a second copy of the snippet, the Messenger keeps only the first loader it finds, so one install per site is enough.

Only these sites can load it

Until you save a site, any site can load the Messenger. Once you save at least one, only the listed sites can load it.

Add a site under Only these sites can load it on ConnectInstall, then select Save. Addresses are kept as an origin, such as https://your-product.com, so a site with and without www needs both.

Local addresses are always allowed: http://localhost and 127.0.0.1 on any port. https://localhost is refused.

A * in a listed address covers every subdomain it stands for, such as https://*.oaki.com.

Check a site

Under Only these sites can load it, open Check a site, enter the site, and select Check. Save your domains first, because the check uses the saved list.

What you see

What it means

What to do

“Your key works on …”

What it means

The key works and the site is on the list.

What to do

Nothing.

“… isn’t on the list, so the Messenger is blocked there.”

What it means

The site is not on the list.

What to do

Select Add beside the site, then Save.

“Your install key isn’t answering: …”

What it means

The key was refused or could not be reached.

What to do

Check your connection and try again.

Hide the Messenger on some pages

On ConnectInstall, under Where it appears, enter a page in Hide on these pages and select Save. The Messenger is then hidden on that page.

Each row takes one page. Select Subpages to hide every page under it too. A rule with no site hides the page on every site the Messenger loads on.

A path after a # in an app that routes by hash hides every page of the app. Query and fragment parts are dropped from a rule.

You can keep up to 50 hidden pages.

Check a page tests one address against the saved rules.

Hide it from your code

Your own steps can hide the Messenger while they run: call CactusMessenger('visibility', 'hidden'), then 'auto' when the flow is done.

Change how it looks

Open ConnectAppearance. The preview on the left shows the Messenger on a sample site, and the panels on the right set it.

  • Launcher: the Default greeting is up to 28 characters.
  • Suggested questions: up to 5 questions.
  • Color scheme: Auto, Light, or Dark.
  • Position: Bottom left, Bottom center, or Bottom right.
  • Eye color: one picker for light sites and one for dark sites, with Reset to brand once either is set.
  • Behavior: switches for Show citations, Show “Powered by Cactus”, Remember past conversations, Tell people when an answer changes, Cactus cursor, Let AI browsers use Cactus, and Debug logging.
  • Sound: Play sounds.

The logo comes from SettingsAppearance, not from this page.

Until you save, the bar reads You have unsaved changes. Your site still shows the last saved design. Discard drops the unsaved changes.

The preview uses your live key, and test chats show up in the Inbox. Until your live key loads, the preview says it is giving sample answers.

Talk to a human

Talk to a human is always on: an escalation always reaches the team's members. After an escalation, the chat shows a card with your team's name. If Cactus holds an email address for the visitor, the team's reply comes in the chat and by email. If it holds none, the card asks for the visitor's name and email. On a conversation a teammate opened, the reply stays in the chat and the card asks for nothing. What happens after an escalation is on Escalations.

Identify a logged-in visitor

These are optional. A visitor who is not identified still gets the Messenger.

Call CactusMessenger('identify', …) with the visitor's userId, email, and name after they log in. The name labels the conversation, which stays on that browser.

To keep a visitor's conversations across devices, the call also needs an identityToken. Your server makes it as an HMAC-SHA256 of the user's id, keyed with the signing secret.

Create the signing secret

Only the teamspace owner can create or rotate the signing secret. Anyone else sees Only a teamspace owner can change this.

Under Logged-in visitors on ConnectInstall, select Create signing secret.

The secret is shown once, with Copy it now. It’s shown only once. Copy it into your server's secret store, never into client code. No screen shows it again.

A product that already has a secret cannot create another one.

A secret set through an environment variable is set outside this screen, and this screen does not create or rotate it.

Hold Hold to rotate the secret to replace it. Until your server signs with the new secret, visitors stay logged out of their history.

Refuse visitors who are not signed

Refuse unsigned visitors turns away visitors your server has not signed. Use it only on a site where everyone logs in. It cannot be turned on until a signing secret exists.

Share your account context

Call CactusMessenger('context', …) to tell Cactus what your app knows, such as a plan or a step in onboarding. Cactus reads it fresh with each message.

You see what your site sent with each conversation in the Inbox.

If the Messenger does not appear

  • “Add your site to “Only these sites can load it” first. Without it, the Messenger loads unstyled and chat is blocked.” This appears on Set it up when a site is not yet on the list. Add the site, then select Save.
  • Live on does not appear. The site has not loaded the Messenger in the last 24 hours. Load the site in a browser.
  • “Couldn’t load the Messenger’s setup.” Select Retry.

Sources

Related pages