Are you developing a Software-as-a-Service offering or you want to resell one with whom you are partners? Then Heroku add-ons are a way to provide it in the place where your potential customers need it and look for it.
This is Heroku – an established platform for developing cloud applications supported by the leader in the cloud industry Salesforce.
How does your cloud service takes benefit from a Heroku add-on?
This is done through Heroku marketplace. The use case is the following: Somebody develops an application that will be hosted and is developed on the Heroku platform-as-a-service (PaaS). In the Heroku marketplace – called Heroku Elements – he can find add-ons that solve already known problems he has (e.g. user or log management) or look for new possible features that can be provided through the application without increasing complexity for developing them from scratch. That could be a potential customer for your service if it is provided through a Heroku add-on.
What is a Heroku add-on?
Think of a Heroku add-on as a way of integrating your service with the Heroku platform. Through the Heroku add-on an application developed and deployed in Heroku can easily have access to your service.
What are the main steps for creating the add-on?
- Create a web application that provides the logic that will enable communication between Heroku and your services. This application can be hosted to Heroku as well.
- Prepare a file that describes main parameters of the add-on and push it to Heroku.
- Follow the process that Heroku defines through alpha, beta and production stages to make it available to Heroku marketplace.
What does this mean for the developer of the add-on?
Implement provisioning API
Create a web application in one of the languages Heroku supports, that implements provisioning API. Provisioning API requires:
- A provisioning service that can create accounts in your service and return access information back to Heroku.
- A deprovisioning service that takes the required actions, if the add-on is removed from a Heroku application.
- A service for changing between the plans that your service provides.
Install Ruby and the kensa
Kensa is a ruby gem that helps add-on providers integrate their services with Heroku. To do that after installing Ruby run from a command-line tool:
gem install kensa
Prepare add-on manifest file
This is a JSON file containing information relevant to the add-on, such as the URL of the provisioning API implementation, the id of the add-on in Heroku etc. To get a sample add-on manifest file run from a command line tool:
Kensa provides tools for testing the add-on web application. The following commands need to be run from the directory where add-on manifest file is stored.
kensa test provision
kensa test deprovision
In order for Heroku apps to consume your service when your add-on is installed, you’ll need to write a sample that demonstrates how to consume your service from Ruby, using a config var pulled from the environment.
Run the Ruby script run: kensa run ruby script_name.rb
The same test needs to be run for your production add-on:
kensa run –production ruby script_name.rb
- Go to the Provider Portal and register as an add-on provider: https://addons.heroku.com/provider/home
- Install the OAuth plugin:
heroku plugins:install heroku-cli-oauth
- Push the add-on to Heroku by executing the following command from the folder where the add-on manifest file is stored:
This initiates the process of alpha and beta stages that need to be completed in order to make the add-on available to Heroku marketplace.
Getting infos about your API
Once your add-on is submitted you can get information about the apps that have installed by calling the following service:
username is the id of the add-on declared in the add-on manifest file and password is also include in the manifest file as well.
You also need to provide basic authentication through the Authorization header with username, semicolon and password encoded in Base64
For example for username:password addon:Test1234:
Authorization: Basic YWRkb246VGVzdDEyMzQ=
Plans can be created anytime from alpha stage onwards. According to customer feedback to Heroku, it is suggested creating paid add-on plans as the add-on is approaching GA (general availability).
While the add-on is in alpha and beta, there will be only a single ‚test‘ plan available for free for the test users. Plans can be charged only after GA.
What is the offer of logicline?
We can provide you with our experience both in the business and technical parts of creating a Heroku add-on and bring your service closer to your customers in the place where they need it. For more information visit this page.
Analytical information regarding the add-ons can be found in the corresponding links in the page: https://devcenter.heroku.com/categories/extending-heroku
The purpose of this article is to provide a quick overview of the process of add-on development.