> ## Documentation Index
> Fetch the complete documentation index at: https://namespace.so/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Get started

> Create a client and get started with Namespace Devboxes using the TypeScript SDK.

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

## Create your first Devbox

Create a Devbox from the Node.js image, run a command, and delete the Devbox when finished.

```typescript {4,7-10,15-16,19} theme={null}
import { createDevboxClient } from "@namespacelabs/sdk/devbox";

// Create a Devbox Client
const client = createDevboxClient();

// Create a Devbox
const devbox = await client.devboxes.create({
  name: "devbox-created-with-sdk4",
  imageName: "builtin:agents",
});

console.log(`Created Devbox: ${devbox.name} --- ${devbox.id}`);

// Run a command
const result = await devbox.exec(["node", "--version"]);
console.log(result.stdout.trim());

// Close the connection at the end
client.close();
```

<Tip>Always close the client to release its cached connections.</Tip>

See [Devbox Client](/docs/reference/typescript-sdk/devbox/devbox-client) for configuration options and the complete client interface.

## Authenticate with Namespace

For CI/CD and other automated workloads, use [workload identity federation](/docs/reference/typescript-sdk/devbox/authentication#workload-identity-federation) to obtain short-lived Namespace credentials without storing a shared token.

For local development, [install the Devbox CLI](/docs/reference/devbox-cli/installation) and authenticate:

```bash theme={null}
devbox login
```

The SDK discovers credentials established by federation, the local user token created by `devbox login`, or a Namespace workload token. See [Authenticate with Namespace](/docs/reference/typescript-sdk/devbox/authentication) for the complete resolution order and explicit token sources.

## Explore the SDK

<Columns cols={2}>
  <Card title="Create and manage Devboxes" icon="container" href="/docs/reference/typescript-sdk/devbox/manage">
    Create Devboxes and control their lifecycle.
  </Card>

  <Card title="Run commands" icon="terminal" href="/docs/reference/typescript-sdk/devbox/commands">
    Execute structured commands and shell scripts.
  </Card>

  <Card title="Use interactive terminals" icon="square-terminal" href="/docs/reference/typescript-sdk/devbox/terminals">
    Open and control pseudo-terminal sessions.
  </Card>

  <Card title="Work with files" icon="file" href="/docs/reference/typescript-sdk/devbox/files">
    Transfer and manipulate files and directories.
  </Card>

  <Card title="Interact with the display" icon="monitor" href="/docs/reference/typescript-sdk/devbox/display">
    Capture screenshots and send pointer input.
  </Card>

  <Card title="Use blueprints" icon="layers" href="/docs/reference/typescript-sdk/devbox/blueprints">
    Create reusable Devbox configurations.
  </Card>

  <Card title="Manage images" icon="hard-drive" href="/docs/reference/typescript-sdk/devbox/images">
    Register, inspect, and optimize images.
  </Card>

  <Card title="Handle errors and timeouts" icon="triangle-alert" href="/docs/reference/typescript-sdk/devbox/errors">
    Cancel operations and handle SDK failures.
  </Card>
</Columns>
