Recent searches
No recent searches
Migrating from Classic Web Widget to Messenger
Posted Feb 04, 2022
Is there a way to detect if `snippet.js` is loading the Classic Web Widget or the new Messenger Web Widget? There is `zE.version` but that doesn't return any identifying info.
We're working on migrating from the Classic Web Widget to Messenger and since that control is within Zendesk we need to be able to temporarily support both types in our codebase.
For example, setting the z-index in classic uses `window.zE('webWidget', 'updateSettings', { webWidget: { zIndex: 999999 } });` but in Messenger it uses `window.zE('messenger:set', 'zIndex', 999999);`. When the classic widget is enabled calling `messenger:set` throws an exception.
Is is there a way to detect if the snippet is loading Classic or Messenger so we can easily switch between these two options?
1
1 comment
Miranda Burford
Hi Jesse,
This isn't officially supported but you can check for the presence of our Classic APIs, like zE.identify or zE.hide. These aren't supported on the messaging widget so they will return undefined on messaging.
You raise a good use case though. Thank you for that! We are currently discussing how we can better support switching between the two widgets in the future.
- Miranda.
0