What is @linear/sdk?
@linear/sdk is an SDK for interacting with the Linear API, which allows developers to programmatically manage issues, projects, teams, and other resources within the Linear app. It provides a convenient way to integrate Linear's functionalities into your own applications.
What are @linear/sdk's main functionalities?
Authentication
This feature allows you to authenticate with the Linear API using an API key. The LinearClient instance is then used to make further API calls.
const { LinearClient } = require('@linear/sdk');
const client = new LinearClient({ apiKey: 'your-api-key' });
Create Issue
This feature allows you to create a new issue in a specified team. You need to provide the team ID, title, and description of the issue.
const issue = await client.issueCreate({
teamId: 'team-id',
title: 'New Issue',
description: 'Description of the issue'
});
Fetch Issues
This feature allows you to fetch a list of issues. The issues are returned as an array of nodes, which you can then process or display as needed.
const issues = await client.issues();
console.log(issues.nodes);
Update Issue
This feature allows you to update an existing issue. You need to provide the issue ID and the fields you want to update.
const updatedIssue = await client.issueUpdate('issue-id', {
title: 'Updated Title',
description: 'Updated Description'
});
Delete Issue
This feature allows you to delete an existing issue. You need to provide the issue ID, and it returns a success status.
const deleted = await client.issueDelete('issue-id');
console.log(deleted.success);
Other packages similar to @linear/sdk
jira-client
jira-client is an SDK for interacting with the JIRA API. It provides similar functionalities for managing issues, projects, and other resources within JIRA. Compared to @linear/sdk, jira-client is tailored for JIRA's ecosystem and offers extensive support for JIRA-specific features.
asana
asana is an SDK for interacting with the Asana API. It allows developers to manage tasks, projects, teams, and other resources within Asana. Like @linear/sdk, it provides a convenient way to integrate Asana's functionalities into your applications, but it is specific to the Asana platform.
github
github is an SDK for interacting with the GitHub API. It allows developers to manage repositories, issues, pull requests, and other resources within GitHub. While it offers similar issue management functionalities, it is tailored for GitHub's ecosystem and includes features specific to version control and collaboration.
Linear API
The issue tracking tool you'll enjoy using
Linear helps streamline software projects, sprints, tasks, and
bug tracking. It's built for high-performance teams.
Visit developers.linear.app for the most up to date documentation
🔥 Contribute
The Linear Client uses custom GraphQL Code Generator plugins to produce a typed SDK for all operations and models exposed by the Linear production API.
Structure
This monorepo uses yarn workspaces
and lerna
to publish packages.
Generated code uses file prefix _generated
and should never be manually updated.
Open source packages:
- sdk - The Linear Client SDK for interacting with the Linear GraphQL API
- import - Import tooling for uploading from other systems
- codegen-doc - GraphQL codegen plugin to generate GraphQL fragments and documents
- codegen-sdk - GraphQL codegen plugin to generate Typescript SDK from fragments and documents
- codegen-test - GraphQL codegen plugin to generate a jest test for the Typescript SDK
Get Started
# install dependencies
yarn
# link package dependencies
yarn bootstrap
# build all packages
yarn build
# test all packages
yarn test
# update the schema from the production API
yarn schema
# create changeset for generating CHANGELOG.md
yarn changeset
Plugin Flow
- The @linear/codegen-doc plugin is used by codegen.doc.yml to generate fragments and documents
- The @linear/codegen-sdk plugin is used by codegen.sdk.yml to generate the typed Linear SDK
- The @linear/codegen-test plugin is used by codegen.test.yml to generate a typed jest test
License
Licensed under the MIT License.