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:
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. }),);The next alchemy login adds a Prisma step with two options:
- Environment variable — reads
PRISMA_SERVICE_TOKEN(orPRISMA_API_TOKEN; good for CI). - Service Token — entered interactively, saved under
~/.alchemy/credentials/<profile>/prisma-stored.json.
In CI (CI=true), the environment-variable method is selected
automatically — no prompt, just set PRISMA_SERVICE_TOKEN.
See Profiles for how credentials are stored and switched.
Local dev
Section titled “Local dev”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.
Next steps
Section titled “Next steps”- Prisma overview — resources and compositions.