A Node.js SDK for the Depot API.
Use pnpm or your favorite package manager:
pnpm add @depot/sdk-nodeEach 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-tokendepot.build.v1.BuildServicedepot.build.v1.RegistryServicedepot.buildkit.v1.BuildKitServicedepot.code.v1beta1.CodeServicedepot.core.v1.BuildServicedepot.core.v1.GithubActionsServicedepot.core.v1.ProjectServicedepot.core.v1.UsageServicedepot.core.v1.OrganizationServicedepot.registry.v1beta1.RegistryService
List projects:
import {depot} from '@depot/sdk-node'
async function example() {
const result = await depot.core.v1.ProjectService.listProjects({})
console.log(result.projects)
}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}`}})MIT License, see LICENSE.