Skip to main content

Widget Methods

Here is the list of methods that can be used to interact with the Widget

MethodDescription
createInitializes the widget with the provided options, see Widget Params section
openOpens the widget
closeCloses the widget
destroyUnmounts the widget, it must be created again to be reused

Widget Params​

Here is the list of keys in the params object that is passed when initializing the Widget with the .create(params) method

KeyTypeDescription
widgetTokenstringSession token required to initialize the widget, valid for 10 minutes. This token must be created using the widget token endpoint
publicKeystringPublic key used to initialize the widget. This must always be the same and it is used to verify the authenticity of the loaded widget
buttonModestringWhether you would like to use a personalized trigger of our widget, or use it with a button provided by us. The options can be 'hidden' | 'light' | 'dark'
widgetPropsobjectOptional configurations:
  • hideCloseButton: boolean, whether the close button is hidden to the user. Defauls to false.
  • autoCloseOnSuccess: boolean, whether the widget closes automatically after success. Defaults to false.
  • autoCloseOnRejection: boolean, whether the widget closes automatically after rejection. Defaults to false.
onSuccessfunctionRefer to Widget Callbacks section
onEventfunctionRefer to Widget Callbacks section
onRejectfunctionRefer to Widget Callbacks section