Skip to content

Setup

You need:

Use a separate organization for tests: they create and delete sandboxes, snapshots, volumes, secrets, keys and organizations.

Terminal window
pnpm add @alchemy.run/daytona@latest

Then add Daytona.providers() next to your cloud’s providers:

alchemy.run.ts
import * as Cloudflare from "@alchemy.run/cloudflare";
import * as Daytona from "@alchemy.run/daytona";
import * as Alchemy from "alchemy";
import * as Effect from "effect/Effect";
import * as Layer from "effect/Layer";
export default Alchemy.Stack(
"App",
{ providers: Layer.mergeAll(Cloudflare.providers(), Daytona.providers()) },
Effect.void,
);
Terminal window
alchemy profile edit --add Daytona

Pick Sign in. Alchemy opens Daytona’s device login, the same one daytona login uses, and asks which organization to use if you belong to several. The session refreshes itself.

Signing in is what lets Alchemy create a key for each Worker that uses a binding. Daytona only lets a signed-in user create API keys, organizations, roles and invitations.

Pick API key and paste a key from Keys in the dashboard. An API key covers sandboxes, snapshots, volumes, secrets and registries.

It can’t create the per-Worker keys bindings need unless Daytona has enabled managed API keys for your organization. Give that key every permission, including manage:api_keys.

With CI=true, Alchemy reads DAYTONA_API_KEY instead of a profile, so set it as a secret in your CI. A Stack with bindings needs a key with manage:api_keys. DAYTONA_ORGANIZATION_ID picks the organization when the key’s own isn’t the one you want, and DAYTONA_API_URL is only for a self-hosted Daytona. See CI.

Organizations and API keys covers where a deploy goes and the key each Worker gets. Then build the tutorial.