PREREQUISITESSign up for a developer account on the Client Dashboard.
1. Install the Web Widget SDK
Install the SDK at the root of your project using your preferred package manager.- npm
- yarn
2. Incorporate the SDK
The Web Widget SDK provides multiple modules that you can import and use in your application, depending on your build process.- CommonJS
- ES
- AMD
- UMD
A CommonJS module is exported by this package and available by requiring
@mxenabled/web-widget-sdk. Require this module and build your project with a build tool that supports CommonJS modules (such as browserify).CommonJS
3. Generate the Widget URL
There are two options to generate the widget URL:- Option A: Using a Platform API endpoint
- Option B: Using a proxy server
a. Platform API
Use the Request Widget URL endpoint to get a URL. Note that thisurl expires after ten minutes or upon first use, so you may need to request it again while following this guide.
- Request
- Response
url Widget class option. See Class Options for a complete list.
b. Proxy Server
The SDK can make requests on your behalf to your backend service that calls the Platform API. Pass the proxy URL to a widget component via theproxy option. See Class Options for a complete list.
When using a proxy server, pass the widget’s configurations directly to the widget component.
Configurations List
Configurations List
4. Mount and Unmount the Widget
When you instantiate a widget with options, it mounts itself in the DOM and sets up event listeners. Call theunmount method when closing the widget and before creating a new instance.
SUCCESSYou’ve set up the SDK and embedded the Connect Widget!
Class Options
You can configure the state and behavior of the widget with the following class options.Troubleshooting
If widget events aren’t triggered, check the following:- Ensure your widget URL request is correctly configured for the Web SDK:
ui_message_versionis set to4is_mobile_webviewis set tofalse
- Ensure you use the corresponding widget class for the
widget_typein the widget URL request. For example, if you setwidget_typetoconnect_widget, use theConnectWidgetclass.

