Files
triggerdotdev--trigger.dev/docs/management/advanced-usage.mdx
T
James Ritchie 99f2caf5c2 Docs/new reference section (#1719)
* Moves API reference to a new dropdown section

* Move toubleshooting higher up

* Separates the reference Overview page into new pages

* Removed Projects api and redirects old page to overview

* typo
2025-02-20 11:30:32 +00:00

26 lines
665 B
Plaintext

---
title: Advanced usage
sidebarTitle: Advanced usage
description: Advanced usage of the Trigger.dev management API
---
### Accessing raw HTTP responses
All API methods return a `Promise` subclass `ApiPromise` that includes helpers for accessing the underlying HTTP response:
```ts
import { runs } from "@trigger.dev/sdk/v3";
async function main() {
const { data: run, response: raw } = await runs.retrieve("run_1234").withResponse();
console.log(raw.status);
console.log(raw.headers);
const response = await runs.retrieve("run_1234").asResponse(); // Returns a Response object
console.log(response.status);
console.log(response.headers);
}
```