See how it's done
To demonstrate integrating your SaaS application with Bunny, we provide a sample SaaS application written in Node.JS. This page will cover installation and configuration as well as next steps.
Last updated
Was this helpful?
To demonstrate integrating your SaaS application with Bunny, we provide a sample SaaS application written in Node.JS. This page will cover installation and configuration as well as next steps.
Last updated
Was this helpful?
The Sample Saas application demonstrates the following integration features:
Generating a new account and contact in Bunny based on signups to your app.
Controlling features and limits in the SaaS app based on subscriptions in Bunny.
Self-service upgrade and payment through the Bunny portal.
The Sample SaaS App is a multi-tenant note taking app. The app relies on Bunny to control how many notes can be stored in each tenant. For the sake of simplicity, users are not prompted for a password when signing into the account.
A platform in Bunny holds the integration settings for your SaaS product, such as webhook URLs, tokens and signing keys.
Since we will later install and run the Sample SaaS App locally, and Bunny will need access to it's API, we suggest installing or similar to fascilitate routing the traffic to your local app. Launch ngrok with the following command to setup a tunnel:
ngrok http 3030
In Products -> Platforms click New Platform.
Configure it as following:
Make sure to choose your own signing key.
Copy the ngrok forwarding URL to the webhook URL field:
https://{your ngrok forwarding URL}/api/hook
Setup a new product in your Bunny account. Your trial account may already have a default one with your company name. Note: It's important to select the platform created in the previous step.
Create a new feature called "Notes". Use the following settings:
On the Plans and Add-Ons tab, create a new plan named "Basic". Enable Self-service purchase.
Hit Save.
In the Plan features section, add the newly created feature to the plan.
On the Price Lists tab, create a new price list named "Monthly":
Create a new Price List Charge with the following settings:
Go to Other -> API Clients and click New API Client
Use the following settings:
In a suitable folder on your local environment, clone the Sample SaaS repository:
git clone git@github.com:bunnyapp/sample-saas.git
Copy .env.example to .env and open the .env file in an editor.
Replace {subdomain} with the subdomain of your Bunny account.
Replace {access_token} with the access token generated when configuring the API Client earlier.
Replace {webhook_signing_token} with the Webhook signing key chosen when configuring the platform earlier.
Replace {price_list_code} with the code from the price list created earlier - notes_monthly
Your .env file should look something like this:
In a Terminal, start the app with the following command:
docker-compose up
You're all set! Navigate to http://localhost:3030 to sign up for your Sample SaaS Notes app account.
The Sample SaaS app runs in Docker, so ensure you have Docker Desktop installed and running. You can download it from .