DaytonaDocs

TypeScript SDK

Install and configure rlpsdk.

The TypeScript SDK is published on npm as rlpsdk. It mirrors the official Daytona SDK's TypeScript surface (class names, method names, error types), so most Daytona code ports by changing the import. All methods are async and fully typed, and the package ships both ESM and CommonJS builds.

Install

The current version is 0.2.0. Install the latest, or pin a version for reproducible builds:

TypeScript
npm install rlpsdk          # or: pnpm add rlpsdk / yarn add rlpsdk
 
# pin a specific version
npm install rlpsdk@0.2.0

Configure

Construct a Daytona client with an optional config object. Every field falls back to environment variables — an explicit config value wins, then RLP_*, then DAYTONA_* where a fallback exists.

TypeScript
import { Daytona } from 'rlpsdk'
 
// Explicit configuration
const daytona = new Daytona({
  apiUrl: 'https://api.example.com',
  apiKey: 'rlp_...',
  toolboxUrl: 'https://proxy.example.com/toolbox',
})
 
// Or rely entirely on environment variables
const daytona = new Daytona()
FieldTypeDefaultResolution order
apiUrlstring— (required)config.apiUrl → RLP_API_URL → DAYTONA_API_URL
apiKeystring— (required)config.apiKey → RLP_API_KEY → DAYTONA_API_KEY
toolboxUrlstringundefinedconfig.toolboxUrl → RLP_TOOLBOX_URL → the sandbox DTO's toolboxProxyUrl
targetstring'local'config.target → RLP_TARGET → DAYTONA_TARGET → 'local'

The constructor throws DaytonaValidationError if no API URL can be resolved, and DaytonaAuthenticationError if no API key can be resolved. If no toolbox URL is available from any source, sandbox operations that need it throw DaytonaValidationError at that point. API keys are covered under Authentication.

Quick example

Create a sandbox, run a command in it, then delete it:

TypeScript
import { Daytona } from 'rlpsdk'
 
const daytona = new Daytona()
 
const sandbox = await daytona.create({ image: 'node:22-slim' })
try {
  const result = await sandbox.process.executeCommand('node -e "console.log(6 * 7)"')
  console.log(result.exitCode) // 0
  console.log(result.result)   // 42
} finally {
  await sandbox.delete()
}

See the quickstart for a longer walkthrough.

Reference pages

On this page