# Heroku

## Learn more about Sentry's Heroku integration, which allows you to create releases in Sentry when your Heroku app is deployed.

This integration needs to be set up in each project for which you wish to use it. It is maintained and supported by the [Sentry community](https://open.sentry.io/).

### [Register the Add-on](#register-the-add-on)

Sentry provides a native add-on for Heroku. While this add-on is not required, it will allow you to maintain consolidated billing inside of Heroku, as well as enable easy configuration of your Sentry credentials.

To add Sentry to an existing Heroku app, head over to the [Sentry Heroku add-on](https://elements.heroku.com/addons/sentry) page.

Once done, you’ll be able to confirm that Sentry’s credentials are available via your config:

```bash
heroku config:get SENTRY_DSN
```

If you’re not using the add-on, you can still bind the `SENTRY_DSN` environment variable which the SDK will automatically pick up.

### [Install the SDK](#install-the-sdk)

Whether you’re using the add-on or not, you’ll still need to [install the SDK](/platforms/) per our standard platform-specific instructions.

### [Configure Releases](#configure-releases)

Whether you use the add-on or configure Sentry yourself, you’ll also likely want to grant access to your dyno metadata, which will allow Sentry to automatically pick up the git SHA of the release your dyno is running.

To do this, enable the `runtime-dyno-metadata` feature:

```bash
heroku labs:enable runtime-dyno-metadata -a <app name>
```

This exposes the `HEROKU_SLUG_COMMIT` environment variable, which most Sentry SDKs will automatically detect and use for configuration.

Next, you’ll want to add your repository and set up an app webhook:

1. Start by connecting your repository to your Sentry organization so we automatically retrieve your commit data. Find your repository integration (GitHub, GitLab, Bitbucket, for example) in **Settings > Integrations**. From the Configurations tab, click "Configure".

   [![Configure Heroku integration](/_next/image/?url=%2Fmdx-images%2Fheroku-configure-repo-integration-MOVHJDJQ.png%231154x507\&w=3840\&q=75)](/mdx-images/heroku-configure-repo-integration-MOVHJDJQ.png)

   On the Configure page, click "Add Repository" then select the repository you want to use.

   [![Add repositories](/_next/image/?url=%2Fmdx-images%2Fheroku-repo-add-S372YKBX.png%231854x592\&w=3840\&q=75)](/mdx-images/heroku-repo-add-S372YKBX.png)

2. Find the Heroku integration in **Settings > Integrations**, click "Add to Project", then select the project you want to use with Heroku.

   [![Heroku integration details page](/_next/image/?url=%2Fmdx-images%2Fheroku-integration-detail-E3V7ZIVZ.png%231074x507\&w=3840\&q=75)](/mdx-images/heroku-integration-detail-E3V7ZIVZ.png)

3. In the Heroku integration configuration, specify which repository and deploy environment to be associated with your Sentry project.

   [![Heroku project configuration](/_next/image/?url=%2Fmdx-images%2Fheroku-project-config-AOHV56U2.png%23972x1166\&w=2048\&q=75)](/mdx-images/heroku-project-config-AOHV56U2.png)

4. Navigate to your project’s Release settings and copy the app webhook Heroku cli command to your Heroku configuration.

   [![Heroku release configuration](/_next/image/?url=%2Fmdx-images%2Fheroku-config-XBW7BJIH.png%231632x348\&w=3840\&q=75)](/mdx-images/heroku-config-XBW7BJIH.png)

5. After running the Heroku cli command you'll see a Webhooks Signing Secret. Copy and paste this into the "Webhook Secret" field in Sentry.

You’ll start getting rich commit information and deploy emails with each new release, as well as tracking of which release issues were seen within.
