Prisma Next is distributed as two separate npm packages: theDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/prisma/prisma-next/llms.txt
Use this file to discover all available pages before exploring further.
prisma-next CLI (a dev dependency used at build time) and a target facade such as @prisma-next/postgres (a runtime dependency). This page covers prerequisites, both installation paths, and how to configure the project manually if you prefer not to use the prisma-next init scaffold.
Prerequisites
Before installing, make sure your environment meets these requirements:- Node.js 24 LTS or newer. Prisma Next uses
import ... with { type: 'json' }(JSON import attributes) and other Node.js 24 features. - pnpm (recommended) or npm, yarn, or bun. The CLI and all examples use pnpm.
- PostgreSQL — a running Postgres instance accessible via a
DATABASE_URLconnection string. MongoDB support is available via@prisma-next/mongo(see below).
Install the CLI
Installprisma-next as a dev dependency. It provides the prisma-next binary used to emit contracts, manage the database, and run migrations.
Install the target facade
Install@prisma-next/postgres as a regular (runtime) dependency. This single package includes the config helper, the Node.js runtime facade, the serverless facade, and all transitive type dependencies — you do not need to install adapter or driver packages separately.
Automated scaffold with prisma-next init
You can also run init without installing the CLI first:
Manual setup
If you prefer to configure the project yourself, follow these steps.Create prisma-next.config.ts
Createprisma-next.config.ts at the root of your project. Use the defineConfig export from @prisma-next/postgres/config, which pre-wires the Postgres family, target, adapter, and driver — you only need to supply the schema path and connection options.
prisma-next.config.ts
.env file:
.env
Extension packs
To add an extension pack such aspgvector, install its package and register it in the config:
prisma-next.config.ts
When using
@prisma-next/postgres/config’s simplified defineConfig, the option is named extensions. When using the full @prisma-next/cli/config-types defineConfig directly, the option is named extensionPacks.Add a DATABASE_URL to your environment
The connection string follows the standard Postgres URI format:Emit the contract and initialize the database
With the config and schema in place, emit the contract and bootstrap the database:contract emit writes contract.json and contract.d.ts to the output path set in your config. db init creates the tables described by the contract (additive only — existing tables are not modified).
MongoDB alternative
If you are targeting MongoDB instead of PostgreSQL, install@prisma-next/mongo in place of @prisma-next/postgres and use its defineConfig export:
prisma-next.config.ts
Verify your installation
After setup, confirm everything is working:db verify exits cleanly, your environment is correctly set up and you are ready to write queries.
Next steps
Quickstart
Walk through the full workflow: schema, emit, db init, and first query.
CLI reference
Full reference for every
prisma-next command and flag.CLI configuration
Full reference for every option in
prisma-next.config.ts.Core concepts
Understand the contract-first model that powers Prisma Next.