The Scalingo.js library provides convenient access to the Scalingo API. A documentation is available online
Note: 0.5.0 has a few internal changes (dependencies bumps, switch to esbuild) that may result in breakages.
The package needs to be configured with your token which is available in your Scalingo dashboard.
const scalingo = require('scalingo')
scalingo.clientFromToken("tk-us-...").then(function(client) {
return client.Users.self()
}).then(function(user) {
console.log(user)
})
Or using ES modules, this looks more like:
import Scalingo from 'scalingo'
let client = await Scalingo.clientFromToken("tk-us-...")
let user = await client.Users.self()
console.log(user)
A bunch of examples are available in the examples
folder to show how to use
scalingo.js library. In order to execute them, you need to define the
environment variable SCALINGO_TOKEN
. The token can be created in Scalingo
dashboard. Then modify the example so that
the application name and the possible IDs match one of your application.
Eventually execute the example with:
export SCALINGO_TOKEN="tk-us-...."
node examples/Addons/add_addon.js
npm install
npm run test
Don't forget to update the CHANGELOG.md file.
# If it's a patch (see https://docs.npmjs.com/cli/version.html)
npm version patch
git push --tags
git push origin master
Then create a new release on the scalingo.js Github repository.