Sandbox Kit

Daytona

Install the Daytona provider, set an API key, and create a sandbox.

A Daytona sandbox starts from a snapshot. Pass no create options and Sandbox Kit uses the default snapshot for your target. You need a Daytona API key. This client talks to Daytona SDK v0.225.0.

Install

npm install @sandbox-kit/sandbox @sandbox-kit/daytona

Create a sandbox

Set DAYTONA_API_KEY. This program creates one sandbox and prints its id.

import { daytona } from "@sandbox-kit/daytona";
import { Client } from "@sandbox-kit/sandbox";

await using client = new Client({
  provider: daytona(),
  auth: { apiKey: { key: process.env.DAYTONA_API_KEY! } },
  timeout: 120_000,
});

const sandbox = await client.create();
console.log(sandbox.id);

timeout is milliseconds. await using closes the client when the block ends. Call await client.close() in a finally block when that syntax is unavailable.

Omit auth when the Daytona SDK should use credentials it already finds in the environment. Closing the client here does not delete the sandbox.

Client settings

SettingTypeScriptGo
API URLendpointConfig.Endpoint
TargetregionConfig.Region
Organizationscope.organizationIdScope.OrganizationId
Bearer tokenauth.bearerToken.tokenBearerToken

The default API URL is https://app.daytona.io/api. A remote URL must be HTTPS. HTTP is accepted for localhost and loopback. Sandbox Kit does not read the URL from the environment. A bearer token requires an organization id.

In Go, set an optional string with sandbox.Value. Full field rules are on Configure the client.

Where to go next

You want toOpen
An image, a named snapshot, a size, or a lifetimeCreate a sandbox
Look up, stop, or delete a sandboxManage a sandbox
Work with filesUse files
A failed callRead an error
A project you can runcreate-daytona-sandbox and the Go project

On this page