$npx -y skills add ashish7802/awesome-api-skills --skill linear --agent claude-code
Installs into .claude/skills of the current project.
Sponsors
SSkills DirectorySkills Directory
Is that skill safe to install?
SSkills DirectorySkills Directory
Know which skills are safe — weekly.
Are you the author of Linear?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/ashish7802-linear)
# Linear API & SDK Skill
> **Verification Tier:** `code_example_tested` | **Last Verified:** 2026-11-18
> **Official Docs:** https://linear.app/developers/graphql
## Overview
Linear exposes a strongly typed GraphQL API at `https://api.linear.app/graphql` along with the official `@linear/sdk` TypeScript client and `@linear/sdk/webhooks` verifier.
## Installation
```bash
npm install @linear/sdk
```
## Authentication
Authenticate using either a Personal API Key (`Authorization: <API_KEY>` — note: **no `Bearer` prefix** for Personal API Keys) or an OAuth 2.0 access token (`Authorization: Bearer <OAUTH_TOKEN>`). `new LinearClient({ apiKey })` handles headers automatically.
## Core Concepts
- **Rate Limits & Query Complexity**: Linear enforces both request rate limits (e.g., 1,500–5,000 req/hr depending on auth type) and GraphQL complexity budgets, reported in `X-RateLimit-Requests-Remaining` and `X-RateLimit-Complexity-Remaining`.
- **Cursor Pagination**: Connections return `nodes` and `pageInfo { hasNextPage, endCursor }`; pass `first` (explicit page size) to keep query complexity low.
- **Webhook Security**: Verify incoming webhooks using `LinearWebhookClient` from `@linear/sdk/webhooks` (or HMAC-SHA256 over the raw body against the `Linear-Signature` header) AND check `webhookTimestamp` to reject replayed payloads older than 60 seconds.
## Error Handling & Rate Limits
- Avoid N+1 lazy-relation fetches in `@linear/sdk` loops (e.g., awaiting `issue.assignee` inside a loop over 100 issues); use raw GraphQL queries via `client.client.rawRequest()` for bulk reads.
- Back off until `X-RateLimit-Requests-Reset` when rate-limited.
## Security Best Practices
- Verify both `Linear-Signature` (using `crypto.timingSafeEqual`) and `webhookTimestamp` freshness on webhook endpoints.
- Prefer OAuth 2.0 with minimal scopes (`read`, `write`, `issues:create`) for multi-user apps instead of shared personal API keys.
## AI Pitfalls
- Sending `Authorization: Bearer lin_api_...` for a Personal API Key (Personal API keys do NOT use `Bearer`).
- Triggering N+1 GraphQL requests by resolving lazy SDK getters inside a `for` loop.
- Ignoring `webhookTimestamp` replay protection when validating `Linear-Signature`.
## Production Checklist
- [ ] `LINEAR_API_KEY` or OAuth tokens stored strictly server-side
- [ ] Webhook handler checks `Linear-Signature` over raw body + `webhookTimestamp` window
- [ ] Bulk queries use explicit GraphQL field selection and `first` limits
- [ ] Rate-limit complexity headers monitored
## References
- [Linear GraphQL Docs](https://linear.app/developers/graphql)
- [Linear Webhooks Guide](https://linear.app/developers/webhooks)
## Related skills
- [`github`](../github/SKILL.md) — integrates with
- [`notion`](../notion/SKILL.md) — works well with
- [`slack`](../slack/SKILL.md) — works well with