Web SDK API
Opens the Web SDK.
Closes the Web SDK.
zE('messenger:set', 'locale', newLocale<string>)
Sets the locale of the Web SDK. It overrides the Web SDK's default behavior of matching the same language an end user has set in their web browser.
The command takes a locale string as an argument. For a list of supported locales and associated codes, use the following Zendesk public REST API endpoint: https://support.zendesk.com/api/v2/rosetta/locales/public.json.
Note: This code should be placed immediately after the Web SDK code snippet.
newLocale: String. The locale string to change the locale to.
zE('messenger:set', 'zIndex', newZIndex<number>);
Sets the CSS property z-index on all the iframes for the Web SDK.
When two elements overlap, the z-index values of the elements determine which one covers the other. An element with a greater z-index value covers an element with a smaller one.
By default, all iframes in the Web SDK have a z-index value of
newZIndex: Number. The z-index value to use for all iframes for the Web SDK
zE('messenger:set', 'zIndex', 123);
zE('messenger:set', 'cookies', isEnabled<boolean>);
The Web SDK uses a mixture of cookies as well as local and session storage in order to function.
If the end user has opted out of cookies, you can use the command below to let the Web SDK know that it is unable to use any of these storage options.
Currently, disabling cookies will result in the Web SDK being hidden from the end user and all values in local and session storage being deleted.
isEnabled: Boolean. If false, the Web SDK will be hidden from view and all stored data will be deleted.
zE('messenger:set', 'cookies', false);