3. Create the Linear App
Create the Linear OAuth application that Sinatra uses to read tickets, post comments, and receive webhooks.
Sinatra connects to Linear via a workspace-scoped OAuth application with agent session events enabled.
Create it
Go to https://linear.app/<your-workspace>/settings/api/applications/new.
Fill in:
- Application name: e.g.
Sinatra (Acme). - Description: anything sensible (this is shown to users authorizing the app).
- Developer URL, Callback URL, Webhook URL: described below.
Callback URL
The callback URL handles the OAuth redirect. Set it to:
https://YOUR_PUBLIC_API/install/linear/callback(use your eventual public URL — see step 8).
Webhooks
Toggle Webhooks ON and:
- Webhook URL:
https://YOUR_PUBLIC_API/webhooks/linear. - Events: subscribe to Agent session events and Comment. (
Agent session eventsis required for the main work loop;Commentis required for users to reply to Sinatra's brainstorm and plan comment threads directly.Issue changeis optional.)
Capture the credentials
After saving, the application page shows:
| Env var | Where it came from |
|---|---|
LINEAR_CLIENT_ID | Shown on the app page |
LINEAR_CLIENT_SECRET | Shown on the app page (one-time reveal — copy it now) |
LINEAR_WEBHOOK_SECRET | Webhook signing secret |
GitHub username field
Once your GitHub App from step 2 is created, come back here and fill in the GitHub username field with <your-github-app-slug>[bot]. This is how Linear knows which GitHub account is doing the work the agent ships.
Install it on your workspace
The OAuth install flow happens through the Sinatra API once the stack is running — see step 10 for the install URL.