Linear कनेक्टर

customer-facing issue tracking, product update notifications, और development milestone campaigns के लिए अपने Linear workspace को Tajo के माध्यम से Brevo से कनेक्ट करें।

अवलोकन

PropertyValue
PlatformLinear
CategoryCustom
Setup ComplexityEasy
Official IntegrationNo
Data SyncedIssues, Projects, Users, Events
API TypeGraphQL API
AuthenticationOAuth 2.0 / Personal API Key
Base URLhttps://api.linear.app/graphql

विशेषताएं

  • Issue event sync - issue create, update, और complete events को Brevo contact timelines में forward करें
  • Project milestone tracking - जब projects key milestones तक पहुंचें तो Brevo campaigns trigger करें
  • Customer issue linking - support visibility के लिए Linear issues को Brevo contacts से जोड़ें
  • Label-आधारित segmentation - Linear labels को Brevo contact attributes से map करें
  • Cycle analytics - team performance reporting के लिए sprint/cycle completion data sync करें
  • Webhook-driven automation - Linear webhooks के माध्यम से real-time event forwarding

पूर्वावश्यकताएं

शुरू करने से पहले, सुनिश्चित करें कि आपके पास हैं:

  1. admin access वाला एक Linear workspace
  2. एक Personal API key या OAuth application कॉन्फ़िगर किया हुआ
  3. API access वाला एक Brevo account
  4. सक्रिय subscription वाला एक Tajo account

प्रमाणीकरण

Linear Personal API keys और OAuth 2.0 को support करता है।

विकल्प 1: Personal API Key

  1. Linear > Settings > API > Personal API keys पर जाएं
  2. Create key पर क्लिक करें
  3. इसे “Tajo Integration” नाम दें
  4. generated key कॉपी करें (lin_api_ से शुरू होती है)
Terminal window
curl -X POST https://api.linear.app/graphql \
-H "Authorization: $LINEAR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"query": "{ viewer { id name email } }"}'

विकल्प 2: OAuth 2.0

कई workspaces की सेवा करने वाले integrations के लिए:

  1. linear.app/settings/api/applications पर एक OAuth application बनाएं
  2. redirect URI कॉन्फ़िगर करें: https://app.tajo.io/callbacks/linear
  3. scopes request करें: read, write, issues:create, comments:create

GraphQL API

Linear विशेष रूप से एक GraphQL API का उपयोग करता है। सभी queries और mutations एक single endpoint के माध्यम से जाते हैं: https://api.linear.app/graphql। Tajo सभी GraphQL query construction स्वचालित रूप से संभालता है।

Tajo से कनेक्ट करना

Terminal window
# Personal API Key का उपयोग
tajo connectors install linear \
--api-key $LINEAR_API_KEY
# OAuth का उपयोग
tajo connectors install linear \
--client-id $LINEAR_CLIENT_ID \
--client-secret $LINEAR_CLIENT_SECRET

कॉन्फ़िगरेशन

बेसिक सेटअप

connectors:
linear:
enabled: true
sync:
issues: true
projects: true
cycles: true
users: true
teams:
- key: "ENG"
sync_to_list: 38
- key: "SUPPORT"
sync_to_list: 39
issue_states:
- Backlog
- Todo
- "In Progress"
- Done
- Canceled

Field Mapping

Linear user और issue data को Brevo attributes से map करें:

field_mapping:
# User fields
id: LINEAR_USER_ID
email: email
name: FIRSTNAME
# contact events से mapped issue metrics
last_issue_identifier: LAST_LINEAR_ISSUE
last_issue_state: LAST_ISSUE_STATUS
last_issue_priority: LAST_ISSUE_PRIORITY
total_issues: LINEAR_ISSUE_COUNT
# Project data
current_project: ACTIVE_PROJECT
team_key: LINEAR_TEAM

Event Mapping

event_mapping:
Issue.create: ISSUE_CREATED
Issue.update: ISSUE_UPDATED
Issue.remove: ISSUE_DELETED
Comment.create: COMMENT_ADDED
Project.update: PROJECT_UPDATED
Cycle.update: CYCLE_UPDATED

API Endpoints

Linear एक single GraphQL endpoint का उपयोग करता है। Tajo द्वारा उपयोग किए जाने वाले मुख्य queries और mutations:

OperationTypeउद्देश्य
issuesQueryissues list और filter करें
issueQueryID द्वारा single issue प्राप्त करें
projectsQueryसभी projects list करें
cyclesQuerycycles (sprints) list करें
teamsQueryworkspace teams list करें
usersQueryworkspace members list करें
viewerQueryauthenticated user info प्राप्त करें
issueCreateMutationएक नया issue बनाएं
issueUpdateMutationमौजूदा issue अपडेट करें
commentCreateMutationकिसी issue में comment जोड़ें
webhookCreateMutationएक webhook register करें

उदाहरण GraphQL Query

query GetIssues($filter: IssueFilter, $first: Int, $after: String) {
issues(filter: $filter, first: $first, after: $after) {
nodes {
id
identifier
title
state { name }
priority
assignee { email name }
labels { nodes { name } }
createdAt
updatedAt
}
pageInfo {
hasNextPage
endCursor
}
}
}

कोड उदाहरण

कनेक्टर शुरू करें

import { TajoClient } from '@tajo/sdk';
const tajo = new TajoClient({
apiKey: process.env.TAJO_API_KEY,
brevoApiKey: process.env.BREVO_API_KEY
});
await tajo.connectors.connect('linear', {
apiKey: process.env.LINEAR_API_KEY
});

Issues Sync करें

await tajo.connectors.sync('linear', {
type: 'incremental',
resources: ['issues'],
teams: ['ENG', 'SUPPORT'],
since: '2024-01-01'
});
const status = await tajo.connectors.status('linear');
console.log(status);
// {
// connected: true,
// lastSync: '2024-03-15T18:00:00Z',
// issuesTracked: 3200,
// projectsMonitored: 8,
// usersLinked: 45
// }

Linear Webhooks हैंडल करें

app.post('/webhooks/linear', async (req, res) => {
const event = req.body;
// webhook signature सत्यापित करें
const signature = req.get('Linear-Signature');
if (!verifyLinearSignature(req.body, signature)) {
return res.status(401).send('Unauthorized');
}
await tajo.connectors.handleWebhook('linear', {
type: event.type,
action: event.action,
payload: {
issueId: event.data?.id,
identifier: event.data?.identifier,
title: event.data?.title,
state: event.data?.state?.name,
assigneeEmail: event.data?.assignee?.email
}
});
res.status(200).send('OK');
});

Brevo Event से Issue बनाएं

// जब Brevo contact अनुरोध submit करे तो Linear issue बनाएं
tajo.events.on('contact.event', async (event) => {
if (event.name === 'FEATURE_REQUEST') {
await tajo.connectors.create('linear', {
teamId: 'ENG',
title: `Feature Request: ${event.data.subject}`,
description: event.data.description,
priority: 3,
labelIds: ['feature-request']
});
}
});

Rate Limits

Linear अपने GraphQL API पर rate limits लागू करता है:

Limit TypeValue
Request rateप्रति API key 1,500 requests प्रति घंटा
Query complexityप्रति request 10,000 complexity points
Paginationप्रति page अधिकतम 250 nodes (डिफ़ॉल्ट 50)
Webhooksअसीमित incoming events

Complexity Budget

Linear एक complexity-आधारित rate limiting system का उपयोग करता है। सरल queries कम points खर्च करते हैं। Tajo केवल आवश्यक fields का अनुरोध करके और कुशल pagination का उपयोग करके complexity को न्यूनतम करने के लिए queries को अनुकूलित करता है।

जब limits पार हो जाते हैं तो Linear Retry-After header के साथ 429 Too Many Requests लौटाता है।

समस्या निवारण

सामान्य समस्याएं

समस्याकारणसमाधान
401 Unauthorizedअमान्य या revoked API keyLinear Settings में नई API key generate करें
Query errorsअमान्य GraphQL syntaxLinear के API explorer का उपयोग करके queries validate करें
गायब issuesTeam access प्रतिबंधितसुनिश्चित करें कि API key owner की target teams तक पहुंच है
Webhook fire नहीं हो रहागलत URL या disabledLinear Settings > API > Webhooks में webhook status जांचें
Pagination अधूरीगायब after cursorसुनिश्चित करें कि pagination hasNextPage false होने तक लूप करती है

Debug Mode

connectors:
linear:
debug: true
log_level: verbose
log_queries: true

Connection Test करें

Terminal window
tajo connectors test linear
# ✓ GraphQL API connection successful
# ✓ Workspace access verified
# ✓ Team list readable
# ✓ Issue query operational
# ✓ Webhook registration available

सर्वोत्तम प्रथाएं

  1. Real-time के लिए webhooks का उपयोग करें - issue changes के लिए polling के बजाय webhooks register करें
  2. Team द्वारा filter करें - API usage कम करने के लिए केवल प्रासंगिक teams से issues sync करें
  3. GraphQL queries अनुकूलित करें - complexity limits के भीतर रहने के लिए केवल आवश्यक fields का अनुरोध करें
  4. Labels को segments से map करें - Brevo contact segmentation चलाने के लिए Linear labels का उपयोग करें
  5. Pagination संभालें - पूर्ण data के लिए हमेशा hasNextPage जांचें और endCursor का उपयोग करें
  6. Webhook signatures सत्यापित करें - हमेशा Linear-Signature header को validate करें

सुरक्षा

  • API Key Authentication - workspace तक scoped personal keys
  • OAuth 2.0 - multi-workspace integrations के लिए सुरक्षित authorization flow
  • HTTPS Only - सभी API communication TLS 1.2+ के माध्यम से encrypted
  • Webhook Signatures - HMAC-आधारित signature verification
  • Encrypted Storage - API keys Tajo में at rest encrypted
  • SOC 2 Compliance - Linear platform SOC 2 Type II certified है

संबंधित संसाधन

Subscribe to updates

developer-docs

Drop your email or phone number — we'll send you what matters next.

auto-detect
AI Assistant

Hi! Ask me anything about the docs.