Add deploy hooks to your Heroku app.

Use a Heroku deploy hook to:

  • Report information when you deploy your app to enable linking to code in your source control provider from the releases dashboard, timeline annotations, and stack traces.


Configure Heroku to automatically notify Bugsnag of a new deploy of your app by enabling the Deploy Hooks add-on and configuring a HTTP post hook. You can configure one using the Heroku CLI by running:

heroku addons:create deployhooks:http \

Replace API_KEY, RELEASE_STAGE and REPOSITORY with appropriate values for your project. The full parameter details see deploy hook parameters.

Versioning Heroku apps

Once the Deploy Hook has been created Bugsnag will associate version numbers and source control information together to allow you to view diffs and see the quality of your releases within Bugsnag.

For the version provided by the Deploy Hook and your code to match we recommend using the dyno-metadata Heroku Labs feature. This makes the release version used by Heroku available as an environment variable (HEROKU_RELEASE_VERSION). You can then set your app version in the Bugsnag notifier in your app to that to ensure they match up. For example, in a Ruby app:

Bugsnag.configure do |config|
  config.api_key = ENV['BUGSNAG_API_KEY']
  config.app_version = ENV['HEROKU_RELEASE_VERSION']

Deploy hook parameters

The following parameters can be set as URL parameters on the build.bugsnag.com/heroku URL when setting the deploy hook.


Your project’s API key which can be found in your Settings.


The releaseStage configured for this application. Can be omitted and will default to what is configured in your notifier when an event is first received.


The URL to your source control repository, for example https://github.com/org/repo.


The source control provider you use. Required only for on-premise providers. Must be one of github-enterprise, bitbucket-server, or gitlab-onpremise.