Skip to content
depotPublic

About

Depot API SDK for Node.js

Topics

Resources

Code of conduct

Stars

6 stars

Watchers

1 watching

Forks

Repository files navigation

Depot API SDK for Node.js

CI npm Powered by TypeScript

A Node.js SDK for the Depot API.

👉 API Documentation

Installation

Use pnpm or your favorite package manager:

pnpm add @depot/sdk-node

Usage

Each of the Depot API services is exposed on the main depot export. The service paths match their corresponding gRPC service names. Set the DEPOT_TOKEN environment variable to authenticate requests:

export DEPOT_TOKEN=your-access-token

Example

List projects:

import {depot} from '@depot/sdk-node'

async function example() {
  const result = await depot.core.v1.ProjectService.listProjects({})
  console.log(result.projects)
}

Create a client

Use createClient() to configure a client explicitly:

import {createClient} from '@depot/sdk-node'

const client = createClient({token: 'your-access-token'})
const result = await client.core.v1.ProjectService.listProjects({})
console.log(result.projects)

createClient() accepts an optional token and baseURL. It defaults to https://api.depot.dev and does not read environment variables. If you omit token, supply an authorization header on each call that requires authentication.

To use a different token for an individual call, pass an authorization header:

const result = await depot.core.v1.ProjectService.listProjects({}, {headers: {Authorization: `Bearer ${token}`}})

License

MIT License, see LICENSE.

About

Depot API SDK for Node.js

Topics

Resources

Code of conduct

Stars

6 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages