Popup customer portal
Last updated
Was this helpful?
Last updated
Was this helpful?
This guide covers the customer portal integration from a developers point of view. It assumes that you have already setup your Products in Bunny and enabled them to be visible for self service.
This integration involves adding a Bunny hosted javascript SDK to your application and calling methods on the SDK to popup the subscription management and payment options.
There are 2 steps in this integration.
From your applications backend, generate an token via the Bunny API. This token will be required in step 2 to authenticate access to the portal.
Add the bunny.js
script to your application then use a link on your page to popup the portal.
The API client will need to have the security:read and security:write scopes enabled.
Attributes
Mutation
On success the response will contain a token attribute. You need to extract this token and use it in the next step.
Include the Bunny script in the <head>
section of your application using the subdomain of your Bunny account.
Now initialize the script by passing the portal token from step 1 into the Bunny SDK.
Finally add a button or a link to your site for upgrading or managing a subscription with a click handler that we will use to popup the portal.
You can popup different screens by setting a page argument in the popup
method.
We recommend setting up a new API client specifically for customer portal access. .
Use the API client to with the security scopes.
Make a request from your backend to obtain the portal security token using the graphql request.