Set up GitHub, Linear and webhooks
Last updated:
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.
- Homepage URL: your
APP_URL. - Callback URL:
https://feedback.example.com/api/integrations/github/callback. - Turn on Request user authorization (OAuth) during installation. The app uses it to check that the person connecting can access the installation.
- Setup URL: leave empty. With the option above on, GitHub sends people to the callback URL.
- Webhook URL:
https://feedback.example.com/api/webhooks/github. Set a webhook secret. - Repository permissions: Issues, read and write. Metadata, read-only.
- Subscribe to events: Issues.
- 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.
- Callback URL:
https://feedback.example.com/api/integrations/linear/callback. - Turn on Webhooks. Set the URL to
https://feedback.example.com/api/webhooks/linearand select Issues events. - 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.
- Permissions: add the Jira API with the scopes
read:jira-work,write:jira-workandmanage:jira-webhook. - Authorization callback URL:
https://feedback.example.com/api/integrations/jira/callback. - 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
- Go to api.slack.com/apps, click Create New App, then From scratch, and pick your workspace.
- Open Incoming Webhooks, turn it on, and click Add New Webhook to Workspace.
- Choose the channel and copy the URL. It starts with
https://hooks.slack.com/services/.
Microsoft Teams
- In the channel, open Workflows from the channel menu.
- Choose the template Send webhook alerts to a channel (also called "Post to a channel when a webhook request is received").
- 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.updatedorcomment.createdX-Feedback-Signature:t=<unix seconds>,v1=<hex>.v1is the HMAC-SHA256 of<t>.<raw body>with the endpoint's signing secret.
To verify a delivery:
- Compute the HMAC yourself.
- Compare it with
v1in constant time. - Reject deliveries where
tis 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.