API for Usersnap Rating Project

Exposing the Usersnap API

If you'd like to do further customization with the Usersnap Rating 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', 'john@doe.me');
});

Customizing the button

{
    button: {
        isHidden: true
    }
}
{
    button: {
        position: "rightCenter" //or "rightBottom"
    }
}

Setting the email

api.on('open', function(event) {
    event.api.setValue('visitor', 'john@doe.me');
});

Setting the widget language

api.init({
    locale: 'de',
});
[
  "de",
  "en",
  "fr",
  "es",
  "sv",
  "nl",
  "tr",
  "it"
]

API for Usersnap Rating Project


Suggested Edits are limited on API Reference Pages

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