Skip to content

TypeScript SDK

The TypeScript SDK provides a typed wrapper around the Runta REST API for TypeScript and JavaScript projects.

  • Node.js 18 or newer
  • A Runta API token
  • npm, pnpm, or yarn
Terminal window
npm install @runta/runta-sdk

The easiest setup is an environment variable:

Terminal window
export RUNTA_TOKEN="rt_your_token_here"

The SDK connects to the hosted API by default:

https://api.runta.dev

To use a local or custom API endpoint:

Terminal window
export RUNTA_ENDPOINT="http://127.0.0.1:8080"

You can also pass both values directly in code:

import { Runta } from "@runta/runta-sdk";
const runta = new Runta({
token: "rt_your_token_here",
endpoint: "https://api.runta.dev",
});

Do not commit real tokens to Git.

Authentication uses the first available value from:

SourceKey
Constructornew Runta({ token: "rt_..." })
EnvironmentRUNTA_TOKEN
Config filetoken in RUNTA_CONFIG or ~/.config/runta/config.toml

Endpoint configuration uses the first available value from:

SourceKey
Constructornew Runta({ endpoint: "..." })
EnvironmentRUNTA_ENDPOINT
Config fileendpoint in RUNTA_CONFIG or ~/.config/runta/config.toml
Defaulthttps://api.runta.dev

Example config file:

endpoint = "https://api.runta.dev"
token = "rt_your_token_here"