Replacing the Zendesk Web Widget without touching your zE() calls

How to swap the Zendesk messaging widget for the ChaosDesk messenger by changing one script tag, and what to check before you do.

A person holding a smartphone in both hands
Photo: Priscilla Du Preez / Unsplash

The web widget is often the most widely spread piece of a Zendesk setup: on the help centre, the marketing site, the web app, sometimes inside mobile apps. Each of those places may call zE() to open the widget, set fields or sign customers in. Changing all of that is a project of its own, unless you do not have to.

One tag changes

The ChaosDesk messenger loads from the same kind of script tag and keeps its id:

<script id="ze-snippet" src="https://app.chaosdesk.io/messenger.js?key=YOUR_KEY"></script>

Code that finds the script by id="ze-snippet" keeps working, and async behaves the same. Each brand has its own key in the Admin Center.

Your zE() calls keep working

The global zE function takes the same arguments:

  • zE('messenger', 'open'), 'close', 'show', 'hide'
  • zE('messenger', 'loginUser', ...) and 'logoutUser'
  • zE('messenger:on', 'open' | 'close' | 'unreadMessages', fn)
  • zE('messenger:set', 'locale' | 'zIndex' | 'cookies' | 'conversationFields' | 'conversationTags', ...)

One difference to note: conversationFields takes the ChaosDesk ticket field id or key, not the old Zendesk field id.

Signed-in customers

If you sign customers in with a JWT, the token keeps the same shape. Create a new shared secret in ChaosDesk (do not reuse the old one), point your token service at it, and existing pages keep working.

Before you switch

  • Add https://app.chaosdesk.io to script-src, frame-src and connect-src if your site has a Content Security Policy.
  • Set the allowed domains for the messenger in the Admin Center.
  • Rebuild your bot flows in the ChaosDesk flow builder, or keep the hand-off simple at first.
  • If an external bot runs through Sunshine Conversations, plan its replacement before the Zendesk contract ends.

In mobile apps

Apps that use the Zendesk mobile SDKs need a change: embed the ChaosDesk messenger in a WebView today. Native SDKs are on the roadmap.

The full API is in the messenger docs.

Zendesk is a trademark of Zendesk, Inc. ChaosDesk is not affiliated with Zendesk.

Bring your whole Zendesk history. Keep your way of working.

Import tickets, users, rules and the help centre, run both side by side, and switch when your team is ready.

Send us a line from your work address and we will add you to the early access list.