Linear कनेक्टर
customer-facing issue tracking, product update notifications, और development milestone campaigns के लिए अपने Linear workspace को Tajo के माध्यम से Brevo से कनेक्ट करें।
अवलोकन
| Property | Value |
|---|---|
| Platform | Linear |
| Category | Custom |
| Setup Complexity | Easy |
| Official Integration | No |
| Data Synced | Issues, Projects, Users, Events |
| API Type | GraphQL API |
| Authentication | OAuth 2.0 / Personal API Key |
| Base URL | https://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
पूर्वावश्यकताएं
शुरू करने से पहले, सुनिश्चित करें कि आपके पास हैं:
- admin access वाला एक Linear workspace
- एक Personal API key या OAuth application कॉन्फ़िगर किया हुआ
- API access वाला एक Brevo account
- सक्रिय subscription वाला एक Tajo account
प्रमाणीकरण
Linear Personal API keys और OAuth 2.0 को support करता है।
विकल्प 1: Personal API Key
- Linear > Settings > API > Personal API keys पर जाएं
- Create key पर क्लिक करें
- इसे “Tajo Integration” नाम दें
- generated key कॉपी करें (
lin_api_से शुरू होती है)
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 के लिए:
- linear.app/settings/api/applications पर एक OAuth application बनाएं
- redirect URI कॉन्फ़िगर करें:
https://app.tajo.io/callbacks/linear - 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 से कनेक्ट करना
# 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 - CanceledField 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_TEAMEvent 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_UPDATEDAPI Endpoints
Linear एक single GraphQL endpoint का उपयोग करता है। Tajo द्वारा उपयोग किए जाने वाले मुख्य queries और mutations:
| Operation | Type | उद्देश्य |
|---|---|---|
issues | Query | issues list और filter करें |
issue | Query | ID द्वारा single issue प्राप्त करें |
projects | Query | सभी projects list करें |
cycles | Query | cycles (sprints) list करें |
teams | Query | workspace teams list करें |
users | Query | workspace members list करें |
viewer | Query | authenticated user info प्राप्त करें |
issueCreate | Mutation | एक नया issue बनाएं |
issueUpdate | Mutation | मौजूदा issue अपडेट करें |
commentCreate | Mutation | किसी issue में comment जोड़ें |
webhookCreate | Mutation | एक 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 Type | Value |
|---|---|
| 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 key | Linear Settings में नई API key generate करें |
| Query errors | अमान्य GraphQL syntax | Linear के API explorer का उपयोग करके queries validate करें |
| गायब issues | Team access प्रतिबंधित | सुनिश्चित करें कि API key owner की target teams तक पहुंच है |
| Webhook fire नहीं हो रहा | गलत URL या disabled | Linear Settings > API > Webhooks में webhook status जांचें |
| Pagination अधूरी | गायब after cursor | सुनिश्चित करें कि pagination hasNextPage false होने तक लूप करती है |
Debug Mode
connectors: linear: debug: true log_level: verbose log_queries: trueConnection Test करें
tajo connectors test linear# ✓ GraphQL API connection successful# ✓ Workspace access verified# ✓ Team list readable# ✓ Issue query operational# ✓ Webhook registration availableसर्वोत्तम प्रथाएं
- Real-time के लिए webhooks का उपयोग करें - issue changes के लिए polling के बजाय webhooks register करें
- Team द्वारा filter करें - API usage कम करने के लिए केवल प्रासंगिक teams से issues sync करें
- GraphQL queries अनुकूलित करें - complexity limits के भीतर रहने के लिए केवल आवश्यक fields का अनुरोध करें
- Labels को segments से map करें - Brevo contact segmentation चलाने के लिए Linear labels का उपयोग करें
- Pagination संभालें - पूर्ण data के लिए हमेशा
hasNextPageजांचें औरendCursorका उपयोग करें - Webhook signatures सत्यापित करें - हमेशा
Linear-Signatureheader को 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 है