Skip to main content
The Linear integration uses OAuth 2.0 to connect to your Linear workspace. profClaw can create issues, update their state, sync labels, and receive webhook events from Linear teams.

Setup

1. Create a Linear OAuth app

  1. Go to linear.app/settings/api
  2. Create a new application
  3. Set the callback URL: https://your-host/api/auth/linear/callback
  4. Note the Client ID and Client Secret

2. Configure environment variables

3. Connect via OAuth

The callback at /api/auth/linear/callback stores the access token and associates it with the current user session.

Webhook Events

Linear webhooks arrive at /api/webhooks/linear. Supported event types:

State Mapping

Linear uses workflow states per team. The Linear adapter maps these to profClaw statuses:

Priority Mapping

Label Mapping

Linear labels are synced as profClaw ticket labels. The LabelMapper (src/integrations/linear.ts) maintains a cache of the label ID-to-name mapping per team.

Bidirectional Sync

Configure the Linear sync adapter in settings.yml:
The sync engine pulls changes every 60 seconds using the Linear updatedAt cursor. Pushes happen immediately on local ticket mutations.

Linear Client

The LinearClient class (src/integrations/linear-client.ts) wraps the Linear GraphQL API:
  • createIssue(input) - Create a new issue
  • updateIssue(id, input) - Update title, description, state, priority, or labels
  • deleteIssue(id) - Archive an issue
  • getIssue(id) - Fetch a single issue with state and labels
  • listIssues(options) - Paginated list with cursor support
  • addComment(issueId, body) - Add a comment
  • getTeamStates(teamId) - Fetch workflow states for mapping
  • getTeamLabels(teamId) - Fetch label definitions
All GraphQL operations are authenticated with the Authorization: Bearer <token> header.