Skip to content

Docs/more docs improvements #1718

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

Merged
merged 6 commits into from
Feb 19, 2025
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
2 changes: 2 additions & 0 deletions docs/config/config-file.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -659,6 +659,8 @@ export default defineConfig({

This extension will also add the `FFMPEG_PATH` and `FFPROBE_PATH` to your environment variables, making it easy to use popular ffmpeg libraries like `fluent-ffmpeg`.

Note that `fluent-ffmpeg` needs to be added to [`external`](/config/config-file#external) in your `trigger.config.ts` file.

Follow [this example](/guides/examples/ffmpeg-video-processing) to get setup with Trigger.dev and FFmpeg in your project.

#### esbuild plugins
Expand Down
1 change: 1 addition & 0 deletions docs/docs.json
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,7 @@
"group": "Troubleshooting",
"pages": [
"troubleshooting",
"troubleshooting-debugging-in-vscode",
"upgrading-packages",
"upgrading-beta",
"troubleshooting-alerts",
Expand Down
2 changes: 2 additions & 0 deletions docs/guides/examples/ffmpeg-video-processing.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ export default defineConfig({

You'll also need to add `@trigger.dev/build` to your `package.json` file under `devDependencies` if you don't already have it there.

If you are modifying this example and using popular FFmpeg libraries like `fluent-ffmpeg` you'll also need to add them to [`external`](/config/config-file#external) in your `trigger.config.ts` file.

## Compress a video using FFmpeg

This task demonstrates how to use FFmpeg to compress a video, reducing its file size while maintaining reasonable quality, and upload the compressed video to R2 storage.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,8 @@ export default defineConfig({
if you don't already have it there.
</Note>

If you are modifying this example and using popular FFmpeg libraries like `fluent-ffmpeg` you'll also need to add them to [`external`](/config/config-file#external) in your `trigger.config.ts` file.

### Add your Deepgram and Supabase environment variables to your Trigger.dev project

You will need to add your `DEEPGRAM_SECRET_KEY`, `SUPABASE_PROJECT_URL` and `SUPABASE_SERVICE_ROLE_KEY` as environment variables in your Trigger.dev project. This can be done in the 'Environment Variables' page in your project dashboard.
Expand Down
2 changes: 1 addition & 1 deletion docs/introduction.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ mode: "center"

Trigger.dev is an open source background jobs framework that lets you write reliable workflows in plain async code. Run long-running AI tasks, handle complex background jobs, and build AI agents with built-in queuing, automatic retries, and real-time monitoring. No timeouts, elastic scaling, and zero infrastructure management required.

We provide everything you need to build and manage background tasks: a [CLI and SDK](/config/config-file) for writing tasks in your existing codebase, support for both [regular](/tasks/overview) and [scheduled](/tasks/scheduled) tasks, full observability through our dashboard, and a [Realtime API](/realtime) with [React hooks](/frontend/react-hooks#realtime-hooks) for showing task status in your frontend. You can use [Trigger.dev Cloud](https://cloud.trigger.dev) or [self-host](/open-source-self-hosting) on your own infrastructure.
We provide everything you need to build and manage background tasks: a CLI and SDK for writing tasks in your existing codebase, support for both [regular](/tasks/overview) and [scheduled](/tasks/scheduled) tasks, full observability through our dashboard, and a [Realtime API](/realtime) with [React hooks](/frontend/react-hooks#realtime-hooks) for showing task status in your frontend. You can use [Trigger.dev Cloud](https://cloud.trigger.dev) or [self-host](/open-source-self-hosting) on your own infrastructure.

## Learn the concepts

Expand Down
6 changes: 5 additions & 1 deletion docs/machines.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,11 @@ You can view the Trigger.dev cloud pricing for these machines [here](https://tri
You can also override the task machine when you [trigger](/triggering) it:

```ts
await tasks.trigger<typeof heavyTask>("heavy-task", { message: "hello world" }, { machine: "large-2x" });
await tasks.trigger<typeof heavyTask>(
"heavy-task",
{ message: "hello world" },
{ machine: "large-2x" }
);
```

This is useful when you know that a certain payload will require more memory than the default machine. For example, you know it's a larger file or a customer that has a lot of data.
Expand Down
21 changes: 21 additions & 0 deletions docs/snippets/debugging_in_vscode.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
Debugging your task code in `dev` is supported via VS Code, without having to pass in any additional flags. Create a launch configuration in `.vscode/launch.json`:

```json launch.json
{
"version": "0.2.0",
"configurations": [
{
"name": "Trigger.dev: Dev",
"type": "node",
"request": "launch",
"cwd": "${workspaceFolder}",
"runtimeExecutable": "npx",
"runtimeArgs": ["trigger.dev@latest", "dev"],
"skipFiles": ["<node_internals>/**"],
"sourceMaps": true
}
]
}
```

Then you can start debugging your tasks code by selecting the `Trigger.dev: Dev` configuration in the debug panel, and set breakpoints in your tasks code.
4 changes: 4 additions & 0 deletions docs/tasks/overview.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -297,6 +297,10 @@ export default defineConfig({

<Info>Errors thrown in the `onFailure` function are ignored.</Info>

<Note>
`onFailure` doesn’t fire for some of the run statuses like `Crashed`, `System failures`, and `Canceled`.
</Note>

### `handleError` functions

You can define a function that will be called when an error is thrown in the `run` function, that allows you to control how the error is handled and whether the task should be retried.
Expand Down
8 changes: 8 additions & 0 deletions docs/troubleshooting-debugging-in-vscode.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
title: "Debugging in VS Code"
sidebarTitle: "Debugging in VS Code"
---

import DebuggingInVSCode from '/snippets/debugging_in_vscode.mdx';

<DebuggingInVSCode />
24 changes: 3 additions & 21 deletions docs/upgrading-beta.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ sidebarTitle: "Beta upgrade"
description: "How to update to 3.0.0 from the beta"
---

import DebuggingInVSCode from '/snippets/debugging_in_vscode.mdx';

The Trigger.dev packages are now at version `3.0.x` in the `latest` tag. This is our first official release of v3 under the latest tag, and we recommend anyone still using packages in the `beta` tag to upgrade to the latest version. This guide will help you upgrade your project to the latest version of Trigger.dev.

The major changes in this release are a new build system, which is more flexible and powerful than the previous build system. We've also made some changes to the `trigger.dev` CLI to improve the developer experience.
Expand Down Expand Up @@ -374,27 +376,7 @@ The `.env` file works slightly differently in `dev` vs `deploy`:

### dev debugging in VS Code

Debugging your tasks code in `dev` is now supported via VS Code, without having to pass in any additional flags. Create a launch configuration in `.vscode/launch.json`:

```json launch.json
{
"version": "0.2.0",
"configurations": [
{
"name": "Trigger.dev: Dev",
"type": "node",
"request": "launch",
"cwd": "${workspaceFolder}",
"runtimeExecutable": "npx",
"runtimeArgs": ["trigger.dev@latest", "dev"],
"skipFiles": ["<node_internals>/**"],
"sourceMaps": true
}
]
}
```

Then you can start debugging your tasks code by selecting the `Trigger.dev: Dev` configuration in the debug panel, and set breakpoints in your tasks code.
<DebuggingInVSCode />

### TRIGGER_ACCESS_TOKEN in dev

Expand Down
Loading