Skip to main content
Use the TypeScript SDK to create and operate Namespace Devboxes from Node.js applications. Install the SDK, authenticate with Namespace, create a client, and run a command in your first Devbox.

Install the SDK

Install the SDK and its peer dependencies with your preferred package manager.
This reference imports the Devbox API from @namespacelabs/sdk/devbox. The package root, @namespacelabs/sdk, also re-exports the same API.

Create your first Devbox

Create a Devbox from the Node.js image, run a command, and delete the Devbox when finished.
Always close the client to release its cached connections.
See Create a client for configuration options and the complete client interface.

Authenticate with Namespace

For CI/CD and other automated workloads, use workload identity federation to obtain short-lived Namespace credentials without storing a shared token. For local development, install the Devbox CLI and authenticate:
The SDK discovers credentials established by federation, the local user token created by devbox login, or a Namespace workload token. See Authenticate with Namespace for the complete resolution order and explicit token sources.

Explore the SDK

Create and manage Devboxes

Create Devboxes and control their lifecycle.

Run commands

Execute structured commands and shell scripts.

Use interactive terminals

Open and control pseudo-terminal sessions.

Work with files

Transfer and manipulate files and directories.

Interact with the display

Capture screenshots and send pointer input.

Use blueprints

Create reusable Devbox configurations.

Manage images

Register, inspect, and optimize images.

Handle errors and timeouts

Cancel operations and handle SDK failures.
Last modified on September 14, 2026