Back to Trigger

Overview

docs/management/overview.mdx

4.4.5922 B
Original Source

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.

<CodeGroup>
bash
npm i @trigger.dev/sdk@latest
bash
pnpm add @trigger.dev/sdk@latest
bash
yarn add @trigger.dev/sdk@latest
</CodeGroup>

Usage

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

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

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);