Skip to content

Docs: Adds 2 references to the node.js versions we use for v3 and v4 #2118

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions docs/config/config-file.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ description: "This file is used to configure your project and how it's built."

import ScrapingWarning from "/snippets/web-scraping-warning.mdx";
import BundlePackages from "/snippets/bundle-packages.mdx";
import NodeVersions from "/snippets/node-versions.mdx";

The `trigger.config.ts` file is used to configure your Trigger.dev project. It is a TypeScript file at the root of your project that exports a default configuration object. Here's an example:

Expand Down Expand Up @@ -245,6 +246,10 @@ export default defineConfig({

See our [Bun guide](/guides/frameworks/bun) for more information.

### Node.js versions

<NodeVersions />

## Default machine

You can specify the default machine for all tasks in your project:
Expand Down
16 changes: 16 additions & 0 deletions docs/snippets/node-versions.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
Trigger.dev runs your tasks on specific Node.js versions depending on the version you're using:

- **v3**: Uses Node.js `21.7.3`
- **v4**: Uses Node.js `21.7.3` by default, or Node.js `22.12.0` if you set `runtime: "node-22"` in your `trigger.config.ts`

In v4, you can specify `runtime: "node-22"` to use Node.js 22 like this:

```ts trigger.config.ts
import { defineConfig } from "@trigger.dev/sdk/v3";

export default defineConfig({
project: "<project ref>",
// Your other config settings...
runtime: "node-22", // Uses Node.js 22.12.0
});
```
Comment on lines +8 to +16
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Fix import path in v4 example
The code snippet uses import { defineConfig } from "@trigger.dev/sdk/v3", but since this example demonstrates configuring v4 for Node.js 22, it should import from the new v4 entrypoint (@trigger.dev/sdk). Otherwise, users upgrading to v4 may be directed to an incorrect import.

Please update the snippet as follows:

-```ts trigger.config.ts
-import { defineConfig } from "@trigger.dev/sdk/v3";
+```ts trigger.config.ts
+import { defineConfig } from "@trigger.dev/sdk";
 export default defineConfig({
   project: "<project ref>",
   // Your other config settings...
   runtime: "node-22", // Uses Node.js 22.12.0
 });

<details>
<summary>🤖 Prompt for AI Agents</summary>

In docs/snippets/node-versions.mdx around lines 8 to 16, the import statement
uses the v3 SDK path "@trigger.dev/sdk/v3" but the example is for v4
configuration. Update the import to use the v4 entrypoint by changing it to
"import { defineConfig } from '@trigger.dev/sdk';" to ensure users upgrading to
v4 have the correct import path.


</details>

<!-- This is an auto-generated comment by CodeRabbit -->

6 changes: 6 additions & 0 deletions docs/upgrade-to-v4.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,16 @@ title: "Upgrading to v4"
description: "What's new in v4, how to upgrade, and breaking changes."
---

import NodeVersions from "/snippets/node-versions.mdx";

## What's new in v4?

[Read our blog post](https://trigger.dev/blog/v4-beta-launch) for an overview of the new features.

### Node.js 22 support

<NodeVersions />

### Wait tokens

In addition to waiting for a specific duration, or waiting for a child task to complete, you can now create and wait for a token to be completed, giving you more flexibility and the ability to wait for arbitrary conditions. For example, you can send the token to a Slack channel, and only complete the token when the user has clicked an "Approve" button.
Expand Down