Skip to content
← Public packages

@cameronpak/box

Full Box Public API v1 client: lifecycle, prompts, files, commands, snapshots, environments, webhooks, desktop, hosting, and account.

src/list-environments.ts

13 lines · 542 B · TypeScript
import { boxRequest, type Result } from './client.ts'
import type { BoxEnvironment } from './types.ts'

export type ListEnvironmentsOutput = { environments: Array<BoxEnvironment> }

/**
 * List every non-deleted Box environment with latest-version flags, contents,
 * and per-version box usage. A default environment named base is created on
 * first access if none exists.
 */
export default async function listEnvironments(): Promise<Result<ListEnvironmentsOutput>> {
	return boxRequest<ListEnvironmentsOutput>({ path: '/environments' })
}