In this section you will find step-by-step recipes for integrating the borderless™ Widget into your product. Below you will find recipes to:
Integrate the Widget
Customize the Widget
Widget Integration Recipe
Step
Corresponding Code (JavaScript)
Create Widget iFrame - Create a div element with an iframe element nested inside it. Add the appropriate url in the "src" attribute of the iframe element. Authenticate the widget with your JWT
Set up Event Listener - To access the response data you will need an eventListener to listen for incoming messages. This will catch success and error messages from your widget
window.addEventListener('message',e => { console.log(e.data) // Unable to add contact: // { message: “Sorry, this email is already associated with an account. Please pay them using their handle: @{contactSlug} (I-6303)”} });
Customize Widget Recipe
Step
Corresponding Code (JavaScript)
Get Widget Customizations - Use the /externalContact/widgetCustomizations endpoint to receive information about widget customization options.