API for Platform Project

Exposing the Usersnap API

If you'd like to do further customization with the Usersnap Platform Project widget, you need to install the widget with the following JavaScript code.

With the exposed Usersnap API you can - for example - use window.UsersnapCX.open() to open the widget.

<script>
  window.onUsersnapCXLoad = function(api) {
    api.init();
    window.UsersnapCX = api;
  }
</script>
<script src="https://widget.usersnap.com/load/YOUR-API-KEY?onload=onUsersnapCXLoad" async></script>

Setting default values

api.init({
    defaultValues: {
        comment: "it's me!"
    }
});
api.open({
    defaultValues: {
        comment: "it's me!"
    }
});
api.on('open', function(event) {
    event.api.setValue('visitor', '[email protected]');
});

Customizing the button

api.init({
    button: {
        isHidden: true
    }
});
api.init({
    button: {
        position: "rightCenter" //or "rightBottom"
    }
});

Setting the email

api.on('open', function(event) {
    event.api.setValue('visitor', '[email protected]');
});

Custom data

You can pass any data that is of interest for you as "custom data".

api.on('open', function(event) {
    event.api.setValue('custom', {userID: 'u123', enviroment: 'staging'});
});

This data you can view on the feedback's detail screen under "More details" -> "Custom data"

Updated about 16 hours ago

API for Platform Project


Suggested Edits are limited on API Reference Pages

You can only suggest edits to Markdown body content, but not to the API spec.