Install the Node.js microagent on Heroku applications

Heroku is a Platform as a Service (PaaS) that hosts web applications. Sqreen supports Heroku for Node.js applications.

  1. Review Node.js microagent compatibility to confirm that the Sqreen Microagent for Node.js is compatible with your Node.js application.
  2. Sign up to create your Sqreen account.
  3. Fetch your organization token. From the Sqreen Dashboard, access Account Settings > Environments & Tokens. Your token begins with env_org_. Take note of the token.
  4. After deploying your Node.js app on Heroku, install the microagent package and save it into your project.
    npm install --save sqreen
  5. Require the Sqreen microagent first at the top of your main script.
  6. Set your Sqreen token in your home folder.
    echo '{ "token": "mysecrettoken" }' > sqreen.json
  7. From Terminal, in your application root directory, commit your changes and push them to Heroku. This triggers Heroku to deploy your modifications.
    git commit -m 'Add Sqreen to my application' package.json
    git push heroku master
  8. Add your SQREEN_TOKEN environment variable to your environment.

Learn more about using Sqreen with Heroku: