Skip to content

Setup

Sign up at prisma.io and create a service token in the Prisma Console (workspace settings → service tokens). Register the provider next to your cloud’s:

alchemy.run.ts
import * as Alchemy from "alchemy";
import * as Cloudflare from "alchemy/Cloudflare";
import * as Prisma from "alchemy/Prisma";
import * as Effect from "effect/Effect";
import * as Layer from "effect/Layer";
export default Alchemy.Stack(
"App",
{
providers: Layer.mergeAll(
Cloudflare.providers(),
Prisma.providers(),
),
state: Alchemy.localState(),
},
Effect.gen(function* () {
// Declare Prisma and Cloudflare resources here.
}),
);

Run alchemy profile edit --add Prisma. The service token is entered interactively and saved under ~/.alchemy/credentials/<profile>/prisma-stored.json.

In CI (CI=true), profiles are bypassed. Set PRISMA_SERVICE_TOKEN or PRISMA_API_TOKEN; Alchemy reads it directly and persists nothing.

See Profiles for how credentials are stored and switched.

bun alchemy dev needs no Prisma credentials. Database resources run against a local @prisma/dev Postgres, Compute resources run their configured dev.command, and the remaining Prisma resources return compatible local outputs. See Postgres for the dev database options.