Skip to content

Setup

Sign up at turso.tech, then create an API token with the Turso CLI:

Terminal window
turso auth api-tokens mint alchemy

Turso only supports API tokens. There is no browser sign-in.

Add Turso.providers() next to your cloud’s providers:

alchemy.run.ts
import * as Turso from "alchemy/Turso";
providers: Layer.mergeAll(Cloudflare.providers(), Turso.providers()),
Terminal window
alchemy profile edit --add Turso

Paste the token when asked. You can leave the organization blank.

If you belong to more than one organization, enter its name. turso org list shows them.

See Profiles to learn how profiles work.

Set TURSO_API_TOKEN and Alchemy uses it instead of your profile:

Terminal window
TURSO_API_TOKEN=... alchemy deploy

TURSO_API_KEY works too. Set TURSO_ORGANIZATION if you belong to more than one organization.

Use a token you already have, for example in tests:

Effect.provide(
Turso.fromToken({
apiToken: "...",
organization: "my-org",
}),
)

apiToken can be a string or a Redacted value.