Specify the necessary values in the window object. Add the following script to your HTML header or in an HTML element on your Bubble page:
<script> window.pluggy = { connectTokenUrl: 'YOUR_CONNECT_TOKEN_URL', clientUserId: 'YOUR_CLIENT_USER_ID', buttons: [ // Each button of your application that opens Pluggy Connect should be listed here. // If updateItem is defined, it will open a widget to update the item ID. { clientUserId: 'YOUR_CLIENT_USER_ID', buttonClassName: 'your-button-class', updateItem: null // Replace with item ID if updating an existing item } ] };</script>
Buttons List: The buttons array should contain an entry for each button in your application that triggers Pluggy Connect. If an updateItem value is provided, the widget will open in "update mode" to update the specified item. Otherwise, it will open the standard connection flow.
POST Endpoint for Token: The connectTokenUrl should be a POST endpoint that returns the access token in the following format:
The response must be an object like the following:
Ensure that your connectTokenUrl endpoint is correctly set up to return the access token and that the clientUserId is correctly passed.
This guide provides a structured way to integrate and customize the Pluggy Connect widget within your Bubble application. Adjust the values as per your application's requirements and test thoroughly to ensure proper integration.