@trigger.dev/sdk
4.8.8 · 20 Nov 2026MIT1.7M / weekRepositoryHomepagenpmAtom feed
180 stable releases, newest first, by release line. Notes are quoted as the maintainers published them.
2.3.19
24 May 2024Reading the note…
2.3.18
12 Feb 2024Reading the note…
2.3.17
30 Jan 2024Reading the note…
2.3.16
21 Jan 2024Reading the note…
2.3.15
17 Jan 2024Reading the note…
2.3.13
17 Jan 2024Reading the note…
2.3.12
16 Jan 2024Reading the note…
2.3.11
12 Jan 2024Reading the note…
2.3.10
10 Jan 2024Reading the note…
2.3.9
3 Jan 2024Reading the note…
2.3.8
22 Dec 2023Reading the note…
2.3.7
22 Dec 2023Reading the note…
2.3.6
14 Dec 2023Reading the note…
2.3.5
13 Dec 2023Reading the note…
2.3.4
8 Dec 2023Reading the note…
2.3.3
7 Dec 2023Reading the note…
2.3.2
6 Dec 2023Reading the note…
2.3.1
6 Dec 2023Reading the note…
2.3.0
6 Dec 2023Support for Deno, Bun and Cloudflare workers, as well as conditionally exporting ESM versions of the package instead of just commonjs.
Cloudflare worker support requires the node compat flag turned on (developers.cloudflare.com/workers/runtime-apis/…)
Minor Changes
Support for Deno, Bun and Cloudflare workers, as well as conditionally exporting ESM versions of the package instead of just commonjs.
Cloudflare worker support requires the node compat flag turned on (developers.cloudflare.com/workers/runtime-apis/…)
2.2.11
4 Dec 2023Reading the note…
2.2.10
30 Nov 2023Reading the note…
2.2.9
29 Nov 2023Reading the note…
2.2.8
28 Nov 2023Reading the note…
2.2.7
16 Nov 2023Reading the note…
2.2.6
10 Nov 2023Reading the note…
2.2.5
7 Nov 2023Reading the note…
2.2.4
1 Nov 2023Reading the note…
2.2.3
26 Oct 2023Reading the note…
2.2.2
24 Oct 2023Reading the note…
2.2.1
24 Oct 2023Reading the note…
2.2.0
13 Oct 2023- Breaking
Drop support for Node v16, require Node >= 18. This allows us to use native fetch in our SDK which paves the way for multi-platform support.
Minor Changes
- Breaking
Drop support for Node v16, require Node >= 18. This allows us to use native fetch in our SDK which paves the way for multi-platform support.
2.1.9
6 Oct 2023Reading the note…
2.1.8
4 Oct 2023Reading the note…
2.1.7
30 Sep 2023Reading the note…
2.1.6
27 Sep 2023Reading the note…
2.1.5
26 Sep 2023Reading the note…
2.1.4
22 Sep 2023Reading the note…
2.1.3
14 Sep 2023Reading the note…
2.1.2
14 Sep 2023Reading the note…
2.1.1
13 Sep 2023Reading the note…
2.1.0
6 Sep 2023Gets all the records (rows)
Gets a single record
Create a new record
runTask changes (@trigger.dev/sdk 2.1.0+)
The most important change to be aware of is that we've moved the options param to the third param, and made it optional. When you upgrade your package, you will need to change the order (or if you want you can remove the options).
//old package (@trigger.dev/sdk v2.0.14) const response = await io.runTask( "my-task", //this param is required, name is required, and it's before the callback { name: "My Task" }, async () => { return await longRunningCode(payload.userId); }, ); //new package (@trigger.dev/sdk v2.1.0) const response = await io.runTask( "my-task", async () => { return await longRunningCode(payload.userId); }, //options are third, and they're not required. name isn't required, if you do pass options. { name: "My Task" } );This change was made because it was sometimes annoying having to come up with a Task name, when there wasn't a good one. It also moves the most important param, the actual code you want to run, earlier.
New docker image: v2.1.0
If you're self-hosting you'll need to update to the latest image, before you update your packages to the latest. There are new API endpoints that the new packages use, as well as database migrations.
Integration improvements
Less rigid structure and generic support
Previously integrations had quite a rigid structure. Tasks could only live at the top-level. This also meant we couldn't do nice generic type support.
It meant we had slightly awkward names for some of the function calls as well.
//old package (@trigger.dev/openai v2.0.14) const models = await io.openai.listModels("list-models"); //new package (@trigger.dev/openai v2.1.0) //this still works const models = await io.openai.listModels("list-models"); //this is new, and closely matches the official SDK structure const models = await io.openai.models.list("list-models");We've made sure that the new integration packages are all backwards compatible. You won't need to update your code to use the more structured Tasks.
integration.runTask
All the integrations now have a
runTaskfunction that allows you to more easily use a native SDK function we don't support:const price = await io.stripe.runTask( "create-price", async (client, task) => { //client is the authenticated Stripe SDK return client.prices.create( { unit_amount: 2000, currency: "usd", product_data: { name: "T-shirt", }, }, { idempotencyKey: task.idempotencyKey, } ); }, //this is optional, it will appear on the Run page { name: "Create Price" } );Creating integrations
It's now easier to make them, as we've dropped the concept of AuthenticatedTasks. It's more intuitive and like regular code you're used to writing. The guide in the docs on creating integrations needs updating still, but will be done soon including how to add webhooks (currently missing).
Airtable integration (but no webhooks… yet)
The integration changes were required to give a great experience with Airtable. You can set the types of your Table and then use the SDK with nice types.
const airtable = new Airtable({ id: "airtable-oauth", }); //The types for my table type Status = "Live" | "Complete" | "In progress" | "Planning" | "In reviews"; type LaunchGoalsAndOkRs = { "Launch goals"?: string; DRI?: Collaborator; Team?: string; Status?: "On track" | "In progress" | "At risk"; "Key results"?: Array<string>; "Features (from 💻 Features table)"?: Array<string>; "Status (from 💻 Features)": Array<Status>; }; client.defineJob({ id: "airtable-example-1", name: "Airtable Example 1: getRecords", version: "0.1.0", trigger: eventTrigger({ name: "airtable.example", schema: z.object({ baseId: z.string(), tableName: z.string(), }), }), integrations: { airtable, }, run: async (payload, io, ctx) => { //set the type on the table const table = io.airtable.base(payload.baseId).table<LaunchGoalsAndOkRs>(payload.tableName); //now everything that uses table has nice types const records = await table.getRecords("multiple records", { fields: ["Status"] }); await io.logger.log(records[0].fields.Status ?? "no status"); const aRecord = await table.getRecord("single", records[0].id); const newRecords = await table.createRecords("create records", [ { fields: { "Launch goals": "Created from Trigger.dev", Status: "In progress" }, }, ]); const updatedRecords = await table.updateRecords( "update records", newRecords.map((record) => ({ id: record.id, fields: { Status: "At risk" }, })) ); await io.wait("5 secs", 5); const deletedRecords = await table.deleteRecords( "delete records", updatedRecords.map((record) => record.id) ); }, });That Job:
Gets all the records (rows)
Gets a single record
Create a new record
Updates the record that was just created
Waits 5 seconds
Deletes the record that was created/updated
Unfortunately Airtable webhooks aren't quite ready yet. Airtable send such frequent webhooks, like when a user is typing in a cell, we need to batch the updates together so we're triggering tons of runs. They're coming soon though.
Package updates
All of the packages have been updated to 2.1.0.
@trigger.dev/airtable
@trigger.dev/sdk
@trigger.dev/github
@trigger.dev/openai
@trigger.dev/plain
@trigger.dev/resend
@trigger.dev/sendgrid
@trigger.dev/slack
@trigger.dev/stripe
@trigger.dev/supabase
@trigger.dev/typeform
@trigger.dev/astro
@trigger.dev/cli
@trigger.dev/core
@trigger.dev/eslint-plugin
@trigger.dev/express
@trigger.dev/nextjs
@trigger.dev/react
Upgrading all your packages with the CLI
To upgrade to the latest packages, run
npx @trigger.dev/cli@latest update2.0.14
28 Aug 2023Reading the note…
2.0.13
28 Aug 2023Reading the note…
2.0.12
27 Aug 2023Reading the note…
2.0.11
24 Aug 2023Reading the note…
2.0.10
21 Aug 2023Reading the note…
2.0.9
16 Aug 2023Reading the note…
2.0.8
11 Aug 2023Reading the note…
2.0.7
9 Aug 2023Reading the note…
2.0.6
8 Aug 2023Reading the note…
A whole project to check? Paste its package.json in the dependency check: every deprecated, outdated or vulnerable dependency, with what to upgrade to. Free, no account.