Back to APIs

Subscribe to issues and manage your teams projects.

Using our official Linear integration

Easily subscribe to Linear webhooks to trigger your jobs.

Create any tasks possible with the Linear API.

Use io.runTask() and the official SDK or fetch.

Linear integration docs

Example code using Linear

Below are some working code examples of how you can use Linear with Trigger.dev. These samples are open source and maintained by the community, you can copy and paste them into your own projects.

1
import { TriggerClient } from "@trigger.dev/sdk";
2
import { Linear } from "@trigger.dev/linear";
3
4
const linear = new Linear({
5
id: "linear",
6
apiKey: process.env.LINEAR_API_KEY!,
7
});
8
9
client.defineJob({
10
id: "linear-new-issue-reply",
11
name: "Linear: automatically reply to new issues",
12
version: "1.0.0",
13
integrations: {
14
linear,
15
},
16
trigger: linear.onIssueCreated(),
17
run: async (payload, io, ctx) => {
18
const newIssueId = payload.data.id;
19
await io.linear.createComment("create-comment", {
20
issueId: newIssueId,
21
body: "Thanks for opening this issue!",
22
});
23
await io.linear.createReaction("create-reaction", {
24
issueId: newIssueId,
25
emoji: "+1",
26
});
27
},
28
});