Installation

The management API is available through the same @trigger.dev/sdk package used in defining and triggering tasks. If you have already installed the package in your project, you can skip this step.

npm i @trigger.dev/sdk@latest

Usage

All v3 functionality is provided through the @trigger.dev/sdk/v3 module. You can import the entire module or individual resources as needed.

import { configure, runs } from "@trigger.dev/sdk/v3";

configure({
  // this is the default and if the `TRIGGER_SECRET_KEY` environment variable is set, can omit calling configure
  secretKey: process.env["TRIGGER_SECRET_KEY"],
});

async function main() {
  const runs = await runs.list({
    limit: 10,
    status: ["COMPLETED"],
  });
}

main().catch(console.error);