Skip to content

Getting started

Installation

During the private alpha, the SDKs and the CLI come from a checkout of the Bok Joy repository. Here is how to install each one.

On this page

What you install#

PieceWhat it isWhere it comes from
Node SDK@bokjoy/sdk: the task runtime and the trigger clientsdk/node in the checkout
Python SDKbokjoy: the same, for Pythonsdk/python in the checkout
CLIdurable-compute: serve, deploy, run, inspect, keys, variables, workersBuilt from the checkout with Cargo

Task code does not import the SDK to run: each handler receives its ctx from the SDK's runner, which a deploy bundles from the sdk folder at your project root (Deploying). You install an SDK in the apps that trigger runs, and in task projects for editor types.

Node SDK#

Bok Joy supports Node 24 and later. The trigger client is an ES module, so use .mjs files or set "type": "module" in your app's package.json.

Terminal
npm install /path/to/bokjoy/sdk/node

npm links the folder into node_modules/@bokjoy/sdk, so you import it by its public name:

JavaScript
import { tasks, runs, configure } from '@bokjoy/sdk';

Some bundlers do not follow a link to a folder outside the project. A Next.js build fails with Can't resolve '@bokjoy/sdk'. For those apps, put install-links=true in the app's .npmrc before you install, and npm copies the folder instead. Run npm install again after you update the checkout. The Next.js guide does this.

The package has no dependencies. Types ship with it, and @bokjoy/sdk/client imports the trigger client on its own.

Python SDK#

The package needs Python 3.10 or later and uses only the standard library.

Terminal
pip install /path/to/bokjoy/sdk/python
Python
from bokjoy import tasks, runs, configure

The Python client is synchronous. bokjoy.client also exports subscribe_to_run, the stream client.

CLI#

The CLI needs Rust with Cargo. Build it at the same commit as the control plane it talks to:

Terminal
cd /path/to/bokjoycargo build --locked --releaseexport PATH="$PWD/target/release:$PATH"durable-compute --help

A local control plane also needs Docker for its Postgres and for resource-limited execution. The Quickstart starts one.

The CLI reads its control plane from DC_API_URL (default http://127.0.0.1:19847) and its credential from DC_API_TOKEN. Commands that run tasks, such as run, list, inspect and event, accept an environment API key there. Commands that manage keys and variables take the operator token or a personal access token. Commands that manage workers need the operator token. deploy and serve open the database directly.

Point an app at the hosted alpha#

The hosted alpha's control plane is https://api.bokjoy.dev. An app needs that URL and an environment API key:

Terminal
export BOKJOY_API_URL=https://api.bokjoy.devexport BOKJOY_API_KEY=bjk_prod_...

During the alpha, your first API keys come from the Bok Joy team, and a personal access token lets you create more with the CLI. Set up the client covers every option.