Skip to content
Merged
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
100 changes: 100 additions & 0 deletions docs/config/config-file.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,20 @@ export default defineConfig({
});
```

## Custom tsconfig path

You can specify a custom path to your tsconfig file. This is useful if you have a custom tsconfig file that you want to use.

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

export default defineConfig({
project: "<project ref>",
dirs: ["./trigger"],
tsconfig: "./custom-tsconfig.json", // Custom tsconfig path
});
```

## Lifecycle functions

You can add lifecycle functions to get notified when any task starts, succeeds, or fails using `onStart`, `onSuccess` and `onFailure`:
Expand Down Expand Up @@ -277,6 +291,21 @@ export default defineConfig({

The `logLevel` only determines which logs are sent to the Trigger.dev instance when using the `logger` API. All `console` based logs are always sent.
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

Console logging statement contradicts new options.

“All console based logs are always sent.” is no longer accurate with disableConsoleInterceptor. Clarify the default and the override.

Apply this diff:

-The `logLevel` only determines which logs are sent to the Trigger.dev instance when using the `logger` API. All `console` based logs are always sent.
+The `logLevel` only determines which logs are sent when using the `logger` API. Console-based logs are sent by default, unless `disableConsoleInterceptor` is set to `true`.
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
The `logLevel` only determines which logs are sent to the Trigger.dev instance when using the `logger` API. All `console` based logs are always sent.
The `logLevel` only determines which logs are sent when using the `logger` API. Console-based logs are sent by default, unless `disableConsoleInterceptor` is set to `true`.
🤖 Prompt for AI Agents
In docs/config/config-file.mdx around line 292, the sentence "All `console`
based logs are always sent." is inaccurate because `disableConsoleInterceptor`
can override that behavior; update the text to state the default behavior
(console logs are sent to the Trigger.dev instance unless
`disableConsoleInterceptor: true` is set) and clarify that `logLevel` controls
which logs the `logger` API sends while console interception can be disabled by
the `disableConsoleInterceptor` option; make the wording concise and explicit
about the default and the override.


## Console logging

You can control console logging behavior in development:

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

export default defineConfig({
project: "<project ref>",
// Your other config settings...
enableConsoleLogging: true, // Enable console logging while running dev CLI
disableConsoleInterceptor: false, // Disable console interceptor (prevents logs from being sent to the trigger.dev dashboard)
});
```

## Max duration

You can set the default `maxDuration` for all tasks in your project:
Expand All @@ -293,6 +322,71 @@ export default defineConfig({

See our [maxDuration guide](/runs/max-duration) for more information.

## Process keep alive

Keep the process alive after the task has finished running so the next task doesn't have to wait for the process to start up again.

Note that the process could be killed at any time, and we don't make any guarantees about the process being alive for a certain amount of time

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

export default defineConfig({
project: "<project ref>",
// Your other config settings...
processKeepAlive: true,
});
```

You can pass an object to the `processKeepAlive` option to configure the behavior:

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

export default defineConfig({
project: "<project ref>",
// Your other config settings...
processKeepAlive: {
enabled: true,
// The maximum number of executions per process. If the process has run more than this number of times, it will be killed.
maxExecutionsPerProcess: 50, // Default: 50
// The maximum number of concurrent processes to keep alive in dev.
devMaxPoolSize: 25, // Default: 25
},
});
```

## Development behavior

You can control the working directory behavior in development:

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

export default defineConfig({
project: "<project ref>",
// Your other config settings...
legacyDevProcessCwdBehaviour: false, // Default: true
});
```

When set to `false`, the current working directory will be set to the build directory, which more closely matches production behavior.

## CA certificates

CA Cert file to be added to NODE_EXTRA_CA_CERT environment variable, useful in use with self signed cert in the trigger.dev environment.
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

Correct env var and grammar (NODE_EXTRA_CA_CERTS; self‑signed).

Use the correct Node env var and improve phrasing.

Apply this diff:

-CA Cert file to be added to NODE_EXTRA_CA_CERT environment variable, useful in use with self signed cert in the trigger.dev environment.
+CA certificate file to be added to the NODE_EXTRA_CA_CERTS environment variable; useful when using a self-signed certificate in the Trigger.dev environment.
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
CA Cert file to be added to NODE_EXTRA_CA_CERT environment variable, useful in use with self signed cert in the trigger.dev environment.
CA certificate file to be added to the NODE_EXTRA_CA_CERTS environment variable; useful when using a self-signed certificate in the Trigger.dev environment.
🧰 Tools
🪛 LanguageTool

[grammar] ~377-~377: There might be a mistake here.
Context: ... certificates CA Cert file to be added to NODE_EXTRA_CA_CERT environment variable...

(QB_NEW_EN)

🤖 Prompt for AI Agents
In docs/config/config-file.mdx around line 377, the sentence uses the wrong Node
environment variable name and has awkward grammar; update it to reference
NODE_EXTRA_CA_CERTS (plural) and improve phrasing to mention "self-signed
certificates" and that the CA cert file should be added to NODE_EXTRA_CA_CERTS,
e.g. rewrite the line to something like: "CA certificate file(s) to add to the
NODE_EXTRA_CA_CERTS environment variable; useful when using self-signed
certificates in the trigger.dev environment." Ensure "NODE_EXTRA_CA_CERTS" is
spelled exactly and replace "self signed cert" with "self-signed certificates."


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

export default defineConfig({
project: "<project ref>",
// Your other config settings...
// Must start with "./" and be relative to project root
extraCACerts: "./certs/ca.crt",
});
```

## Build configuration

You can customize the build process using the `build` option:
Expand All @@ -306,6 +400,12 @@ export default defineConfig({
build: {
// Don't bundle these packages
external: ["header-generator"],
// Automatically detect external dependencies (default: true)
autoDetectExternal: true,
// Keep function/class names in bundle (default: true)
keepNames: true,
// Minify generated code (default: false, experimental)
minify: false,
},
});
```
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/v3/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@ export type TriggerConfig = {
tsconfigPath?: string;

/**
* CA Cert file to be added to NODE_EXTRA_CA_CERT environment variable in, useful in use with self signed cert in the trigger.dev environment.
* CA Cert file to be added to NODE_EXTRA_CA_CERT environment variable, useful in use with self signed cert in the trigger.dev environment.
*
* @example "./certs/ca.crt"
* Note: must start with "./" and be relative to the project root.
Expand Down
Loading