From 410f7a6f140016933436ccec35742de2b8467dc2 Mon Sep 17 00:00:00 2001 From: Claude Date: Mon, 5 Jan 2026 09:54:56 +0000 Subject: [PATCH 1/2] docs: add missing usage import to run-usage code examples Add the missing import statements for the usage object from @trigger.dev/sdk/v3 to the code examples in the run-usage docs. --- docs/run-usage.mdx | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/docs/run-usage.mdx b/docs/run-usage.mdx index 0b9163db1b..60e9434e63 100644 --- a/docs/run-usage.mdx +++ b/docs/run-usage.mdx @@ -8,6 +8,8 @@ description: "Get compute duration and cost from inside a run, or for a specific You can get the cost and duration of the current including retries of the same run. ```ts +import { task, usage, wait } from "@trigger.dev/sdk/v3"; + export const heavyTask = task({ id: "heavy-task", machine: { @@ -87,6 +89,8 @@ console.log("Total cost", totalCost); You can also wrap code with `usage.measure` to get the cost and duration of that block of code: ```ts +import { usage, logger } from "@trigger.dev/sdk/v3"; + // Inside a task run function, or inside a function that's called from there. const { result, compute } = await usage.measure(async () => { //...Do something for 1 second From 68c62266b6e4de89b6ad06df596e4fca6309e832 Mon Sep 17 00:00:00 2001 From: Claude Date: Mon, 5 Jan 2026 10:12:08 +0000 Subject: [PATCH 2/2] docs: use @trigger.dev/sdk without /v3 in run-usage examples Update the import paths to use @trigger.dev/sdk instead of @trigger.dev/sdk/v3 for consistency with other docs examples. --- docs/run-usage.mdx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/run-usage.mdx b/docs/run-usage.mdx index 60e9434e63..4c00423310 100644 --- a/docs/run-usage.mdx +++ b/docs/run-usage.mdx @@ -8,7 +8,7 @@ description: "Get compute duration and cost from inside a run, or for a specific You can get the cost and duration of the current including retries of the same run. ```ts -import { task, usage, wait } from "@trigger.dev/sdk/v3"; +import { task, usage, wait } from "@trigger.dev/sdk"; export const heavyTask = task({ id: "heavy-task", @@ -89,7 +89,7 @@ console.log("Total cost", totalCost); You can also wrap code with `usage.measure` to get the cost and duration of that block of code: ```ts -import { usage, logger } from "@trigger.dev/sdk/v3"; +import { usage, logger } from "@trigger.dev/sdk"; // Inside a task run function, or inside a function that's called from there. const { result, compute } = await usage.measure(async () => {