# Set up GitHub, Linear and webhooks

> Set up the GitHub App, Linear OAuth and signed webhooks for Commentpin, including the environment variables a self-hosted install needs.

Source: https://commentpin.com/docs/integrations
Last updated: 2026-12-03

Each integration stays hidden in the dashboard until its environment variables are set. Replace `https://feedback.example.com` with your `APP_URL`.

## GitHub

Create a GitHub App: GitHub, Settings, Developer settings, GitHub Apps, New GitHub App. Use an organization's settings if the app should belong to the organization.

1. **Homepage URL:** your `APP_URL`.
2. **Callback URL:** `https://feedback.example.com/api/integrations/github/callback`.
3. Turn on **Request user authorization (OAuth) during installation**. The app uses it to check that the person connecting can access the installation.
4. **Setup URL:** leave empty. With the option above on, GitHub sends people to the callback URL.
5. **Webhook URL:** `https://feedback.example.com/api/webhooks/github`. Set a webhook secret.
6. **Repository permissions:** Issues, read and write. Metadata, read-only.
7. **Subscribe to events:** Issues.
8. Create the app, then generate a client secret and a private key.

Set these variables:

| Variable                    | Value                                                            |
| --------------------------- | ---------------------------------------------------------------- |
| `GITHUB_APP_ID`             | App ID                                                           |
| `GITHUB_APP_SLUG`           | The app's URL name, from `github.com/apps/<slug>`                |
| `GITHUB_APP_CLIENT_ID`      | Client ID                                                        |
| `GITHUB_APP_CLIENT_SECRET`  | Client secret                                                    |
| `GITHUB_APP_PRIVATE_KEY`    | Contents of the `.pem` file. On one line, write newlines as `\n` |
| `GITHUB_APP_WEBHOOK_SECRET` | The webhook secret from step 5                                   |

Then open Integrations in the dashboard, click Connect for GitHub, and install the app on the repositories you want. In each project's settings, choose the repository under "Issue tracker".

## Linear

Create an OAuth application: Linear, Settings, API, OAuth applications, New.

1. **Callback URL:** `https://feedback.example.com/api/integrations/linear/callback`.
2. Turn on **Webhooks**. Set the URL to `https://feedback.example.com/api/webhooks/linear` and select **Issues** events.
3. Copy the client ID, the client secret and the webhook signing secret.

Set `LINEAR_CLIENT_ID`, `LINEAR_CLIENT_SECRET` and `LINEAR_WEBHOOK_SECRET`. Then click Connect for Linear on the Integrations page, and choose a team in each project's settings.

## Jira Cloud

Create an OAuth 2.0 (3LO) app in the [Atlassian developer console](https://developer.atlassian.com/console/myapps/).

1. **Permissions:** add the Jira API with the scopes `read:jira-work`, `write:jira-work` and `manage:jira-webhook`.
2. **Authorization callback URL:** `https://feedback.example.com/api/integrations/jira/callback`.
3. Copy the client ID and secret.

Set `JIRA_CLIENT_ID` and `JIRA_CLIENT_SECRET`. Then click Connect for Jira on the Integrations page, and choose a Jira project in each project's settings. Issues are created as Bug when the project has that type, otherwise as Task.

Status changes in Jira come back through a webhook that Commentpin registers for you, limited to the projects you chose. Jira signs each delivery with your client secret. Jira expires these webhooks after 30 days, so the `jira-webhooks` cron job extends them every week. The app's distribution must allow your users: a private (not distributed) app only works for the developer's own Atlassian account.

## How status maps

| Here        | GitHub                | Linear                  | Jira (status category) |
| ----------- | --------------------- | ----------------------- | ---------------------- |
| New         | Open                  | Triage, Todo or Backlog | To Do                  |
| In progress | Open                  | Started                 | In Progress            |
| Resolved    | Closed as completed   | Completed               | Done                   |
| Closed      | Closed as not planned | Canceled                | Done                   |

Jira moves an issue only along the transitions its workflow allows. If no transition reaches the right category, the status here still changes and the Jira issue stays where it is.

## Slack and Microsoft Teams

Post new feedback, status changes and comments to a channel. No app to install in Commentpin: you paste a webhook URL from Slack or Teams in the project settings under **Slack, Microsoft Teams and webhooks**, pick the events and click **Add**. Each message links to the report.

**Slack**

1. Go to [api.slack.com/apps](https://api.slack.com/apps), click **Create New App**, then **From scratch**, and pick your workspace.
2. Open **Incoming Webhooks**, turn it on, and click **Add New Webhook to Workspace**.
3. Choose the channel and copy the URL. It starts with `https://hooks.slack.com/services/`.

**Microsoft Teams**

1. In the channel, open **Workflows** from the channel menu.
2. Choose the template **Send webhook alerts to a channel** (also called "Post to a channel when a webhook request is received").
3. Finish the steps and copy the URL the workflow shows.

The URL is the only credential, so treat it like a password. Anyone with it can post to the channel. Remove the hook in Commentpin and delete the webhook in Slack or Teams to revoke it.

## Outgoing webhooks

Add an endpoint in a project's settings. Each delivery is a JSON `POST` with these headers:

- `X-Feedback-Event`: `feedback.created`, `feedback.updated` or `comment.created`
- `X-Feedback-Signature`: `t=<unix seconds>,v1=<hex>`. `v1` is the HMAC-SHA256 of `<t>.<raw body>` with the endpoint's signing secret.

To verify a delivery:

1. Compute the HMAC yourself.
2. Compare it with `v1` in constant time.
3. Reject deliveries where `t` is more than 5 minutes old.

Failed deliveries are retried with backoff for about two days. Endpoints on private or loopback addresses are refused unless `WEBHOOKS_ALLOW_PRIVATE=true`.
