Prompt Buddy logoPrompt Buddy

prisma ยท Prisma Docs

Prisma AI SDK (with Next.js) (/docs/guides/integrations/ai-sdk)

The page provides guidance on integrating the Vercel AI SDK with Prisma ORM within a Next.js environment to facilitate AI-driven application development.

Import to Prompt Buddy

Derived skill

Files assembled from official documentation

Viewing SKILL.md

Prisma AI SDK (with Next.js) (/docs/guides/integrations/ai-sdk)

The page provides guidance on integrating the Vercel AI SDK with Prisma ORM within a Next.js environment to facilitate AI-driven application development.

When To Use

Use when you need to implement a workflow that combines Vercel AI SDK capabilities with Prisma ORM for data persistence in a Next.js application.

Reference Files

FileContainsUse For
SKILL.mdEntry point: scope, routing table, and workflow.Start here.
docs/prisma-ai-sdk-with-next-js-docs-guides-integrations-workflow-guide.mdA guide explaining how to integrate the Prisma AI SDK within a Next.js application.Questions about a guide explaining how to integrate the Prisma AI SDK within a Next.js application.
examples/prisma-ai-sdk-with-next-js-docs-guides-integrations-prisma-ai-sdk-nextjs.bashThe bash command to initialize a new Next.js application for the Prisma AI SDK integration.Exact payloads, commands, or snippets shown in The bash command to initialize a new Next.js application for the Prisma AI SDK integration.
examples/prisma-ai-sdk-with-next-js-docs-guides-integrations-prisma-ai-sdk-nextjs-2.bashA bash command to initialize a new Next.js application named ai-sdk-prisma using pnpm.Exact payloads, commands, or snippets shown in A bash command to initialize a new Next.js application named ai-sdk-prisma using pnpm.
examples/prisma-ai-sdk-with-next-js-docs-guides-integrations-prisma-ai-sdk-nextjs-3.bashA bash command to initialize a new Next.js application named ai-sdk-prisma using yarn dlx.Exact payloads, commands, or snippets shown in A bash command to initialize a new Next.js application named ai-sdk-prisma using yarn dlx.
examples/prisma-ai-sdk-with-next-js-docs-guides-integrations-prisma-ai-sdk-nextjs-4.bashA bash command to initialize a new Next.js application using bunx for the Prisma AI SDK integration.Exact payloads, commands, or snippets shown in A bash command to initialize a new Next.js application using bunx for the Prisma AI SDK integration.
examples/prisma-ai-sdk-with-next-js-docs-guides-integrations-prisma-ai-sdk-nextjs-5.bashBash commands to navigate to the ai-sdk-prisma directory for the Prisma AI SDK and Next.js integration guide.Exact payloads, commands, or snippets shown in Bash commands to navigate to the ai-sdk-prisma directory for the Prisma AI SDK and Next.js integration guide.
examples/prisma-ai-sdk-with-next-js-docs-guides-integrations-prisma-ai-sdk-nextjs-6.bashBash command to install prisma, tsx, and postgres type definitions for the Prisma AI SDK integration.Exact payloads, commands, or snippets shown in Bash command to install prisma, tsx, and postgres type definitions for the Prisma AI SDK integration.
examples/prisma-ai-sdk-with-next-js-docs-guides-integrations-prisma-ai-sdk-nextjs-7.bashBash command to install prisma, tsx, and postgres types as development dependencies for the Prisma AI SDK with Next.js integration.Exact payloads, commands, or snippets shown in Bash command to install prisma, tsx, and postgres types as development dependencies for the Prisma AI SDK with Next.j...
examples/prisma-ai-sdk-with-next-js-docs-guides-integrations-prisma-ai-sdk-nextjs-8.bashBash commands to install prisma, tsx, and postgres types as development dependencies for the Prisma AI SDK with Next.js.Exact payloads, commands, or snippets shown in Bash commands to install prisma, tsx, and postgres types as development dependencies for the Prisma AI SDK with Next.js.
examples/prisma-ai-sdk-with-next-js-docs-guides-integrations-prisma-ai-sdk-nextjs-9.bashBash commands to install prisma, tsx, and postgres types using bun for the Prisma AI SDK integration.Exact payloads, commands, or snippets shown in Bash commands to install prisma, tsx, and postgres types using bun for the Prisma AI SDK integration.
examples/prisma-ai-sdk-with-next-js-docs-guides-integrations-prisma-ai-sdk-nextjs-10.bashBash command to install the Prisma client, PostgreSQL adapter, and dotenv dependencies for the Prisma AI SDK with Next.js.Exact payloads, commands, or snippets shown in Bash command to install the Prisma client, PostgreSQL adapter, and dotenv dependencies for the Prisma AI SDK with Nex...
examples/prisma-ai-sdk-with-next-js-docs-guides-integrations-prisma-ai-sdk-nextjs-11.bashA bash command to install the Prisma client, PostgreSQL adapter, dotenv, and pg packages required for the Prisma AI SDK with Next.js integration.Exact payloads, commands, or snippets shown in A bash command to install the Prisma client, PostgreSQL adapter, dotenv, and pg packages required for the Prisma AI S...
examples/prisma-ai-sdk-with-next-js-docs-guides-integrations-prisma-ai-sdk-nextjs-12.bashBash commands to install the Prisma client, PostgreSQL adapter, and required dependencies for the AI SDK integration.Exact payloads, commands, or snippets shown in Bash commands to install the Prisma client, PostgreSQL adapter, and required dependencies for the AI SDK integration.
examples/prisma-ai-sdk-with-next-js-docs-guides-integrations-prisma-ai-sdk-nextjs-13.bashA bash command to install the Prisma client, PostgreSQL adapter, dotenv, and pg using the bun package manager for a Next.js AI SDK integration.Exact payloads, commands, or snippets shown in A bash command to install the Prisma client, PostgreSQL adapter, dotenv, and pg using the bun package manager for a N...
examples/prisma-ai-sdk-with-next-js-docs-guides-integrations-prisma-ai-sdk-nextjs-14.bashThe bash command to initialize Prisma with a custom output directory for use in a Next.js application.Exact payloads, commands, or snippets shown in The bash command to initialize Prisma with a custom output directory for use in a Next.js application.
examples/prisma-ai-sdk-with-next-js-docs-guides-integrations-prisma-ai-sdk-nextjs-15.bashA bash command to initialize Prisma with a specific output directory for use with the AI SDK and Next.js.Exact payloads, commands, or snippets shown in A bash command to initialize Prisma with a specific output directory for use with the AI SDK and Next.js.
examples/prisma-ai-sdk-with-next-js-docs-guides-integrations-prisma-ai-sdk-nextjs-16.bashA bash command to initialize Prisma with a specific output directory for use with the AI SDK and Next.js.Exact payloads, commands, or snippets shown in A bash command to initialize Prisma with a specific output directory for use with the AI SDK and Next.js.
examples/prisma-ai-sdk-with-next-js-docs-guides-integrations-prisma-ai-sdk-nextjs-17.bashA bash command to initialize Prisma with a specific output directory using bunx.Exact payloads, commands, or snippets shown in A bash command to initialize Prisma with a specific output directory using bunx.
examples/prisma-ai-sdk-with-next-js-docs-guides-integrations-prisma-ai-sdk-nextjs-18.bashA bash command to initialize a database using the npx create-db utility within a Prisma AI SDK and Next.js integration setup.Exact payloads, commands, or snippets shown in A bash command to initialize a database using the npx create-db utility within a Prisma AI SDK and Next.js integratio...
examples/prisma-ai-sdk-with-next-js-docs-guides-integrations-prisma-ai-sdk-nextjs-19.bashA bash command to initialize a database using the pnpm dlx create-db utility for the Prisma AI SDK integration.Exact payloads, commands, or snippets shown in A bash command to initialize a database using the pnpm dlx create-db utility for the Prisma AI SDK integration.
examples/prisma-ai-sdk-with-next-js-docs-guides-integrations-prisma-ai-sdk-nextjs-20.bashA bash command to initialize the database using yarn dlx create-db for the Prisma AI SDK integration.Exact payloads, commands, or snippets shown in A bash command to initialize the database using yarn dlx create-db for the Prisma AI SDK integration.
examples/prisma-ai-sdk-with-next-js-docs-guides-integrations-prisma-ai-sdk-nextjs-21.bashA bash command using bunx to execute the create-db utility for a Prisma AI SDK and Next.js integration.Exact payloads, commands, or snippets shown in A bash command using bunx to execute the create-db utility for a Prisma AI SDK and Next.js integration.
examples/prisma-ai-sdk-with-next-js-docs-guides-integrations-prisma-ai-sdk-nextjs.prismaA Prisma schema definition including Session and Message models for integrating the AI SDK with Next.js.Exact payloads, commands, or snippets shown in A Prisma schema definition including Session and Message models for integrating the AI SDK with Next.js.
examples/prisma-ai-sdk-with-next-js-docs-guides-integrations-prisma-ai-sdk-nextjs.tsA TypeScript configuration file using defineConfig to set up the Prisma schema and migration paths for a Next.js AI SDK integration.Exact payloads, commands, or snippets shown in A TypeScript configuration file using defineConfig to set up the Prisma schema and migration paths for a Next.js AI S...
examples/prisma-ai-sdk-with-next-js-docs-guides-integrations-prisma-ai-sdk-nextjs-22.bashA bash command to initialize the database schema using Prisma Migrate.Exact payloads, commands, or snippets shown in A bash command to initialize the database schema using Prisma Migrate.
examples/prisma-ai-sdk-with-next-js-docs-guides-integrations-prisma-ai-sdk-nextjs-23.bashA bash command to initialize the database schema using pnpm dlx prisma migrate dev.Exact payloads, commands, or snippets shown in A bash command to initialize the database schema using pnpm dlx prisma migrate dev.
examples/prisma-ai-sdk-with-next-js-docs-guides-integrations-prisma-ai-sdk-nextjs-24.bashA bash command to initialize the database schema using Prisma Migrate within a Next.js project.Exact payloads, commands, or snippets shown in A bash command to initialize the database schema using Prisma Migrate within a Next.js project.
examples/prisma-ai-sdk-with-next-js-docs-guides-integrations-prisma-ai-sdk-nextjs-25.bashA bash command to initialize the database schema using bunx and prisma migrate dev.Exact payloads, commands, or snippets shown in A bash command to initialize the database schema using bunx and prisma migrate dev.
examples/prisma-ai-sdk-with-next-js-docs-guides-integrations-prisma-ai-sdk-nextjs-26.bashThe bash command used to generate the Prisma client for the AI SDK integration.Exact payloads, commands, or snippets shown in The bash command used to generate the Prisma client for the AI SDK integration.
examples/prisma-ai-sdk-with-next-js-docs-guides-integrations-prisma-ai-sdk-nextjs-27.bashA bash command to generate the Prisma client using pnpm dlx.Exact payloads, commands, or snippets shown in A bash command to generate the Prisma client using pnpm dlx.
examples/prisma-ai-sdk-with-next-js-docs-guides-integrations-prisma-ai-sdk-nextjs-28.bashA bash command to generate the Prisma client using yarn dlx.Exact payloads, commands, or snippets shown in A bash command to generate the Prisma client using yarn dlx.
examples/prisma-ai-sdk-with-next-js-docs-guides-integrations-prisma-ai-sdk-nextjs-29.bashA bash command to generate the Prisma client using bunx with the bun runtime.Exact payloads, commands, or snippets shown in A bash command to generate the Prisma client using bunx with the bun runtime.
examples/prisma-ai-sdk-with-next-js-docs-guides-integrations-prisma-ai-sdk-nextjs-30.bashBash commands to initialize the project directory structure and create the prisma client file for a Next.js integration.Exact payloads, commands, or snippets shown in Bash commands to initialize the project directory structure and create the prisma client file for a Next.js integration.
examples/prisma-ai-sdk-with-next-js-docs-guides-integrations-prisma-ai-sdk-nextjs.tsxA TypeScript React component demonstrating the integration of the Prisma AI SDK within a Next.js application environment.Exact payloads, commands, or snippets shown in A TypeScript React component demonstrating the integration of the Prisma AI SDK within a Next.js application environm...
examples/prisma-ai-sdk-with-next-js-docs-guides-integrations-prisma-ai-sdk-nextjs-31.bashThe bash command to install the necessary dependencies for using the Prisma AI SDK with Next.js, including ai, @ai-sdk/react, @ai-sdk/openai, and zod.Exact payloads, commands, or snippets shown in The bash command to install the necessary dependencies for using the Prisma AI SDK with Next.js, including ai, @ai-sd...
examples/prisma-ai-sdk-with-next-js-docs-guides-integrations-prisma-ai-sdk-nextjs-32.bashA bash command to install the necessary dependencies including ai, @ai-sdk/react, @ai-sdk/openai, and zod for the Prisma AI SDK integration.Exact payloads, commands, or snippets shown in A bash command to install the necessary dependencies including ai, @ai-sdk/react, @ai-sdk/openai, and zod for the Pri...
examples/prisma-ai-sdk-with-next-js-docs-guides-integrations-prisma-ai-sdk-nextjs-33.bashBash commands to install the AI SDK, React AI SDK, OpenAI provider, and Zod using yarn.Exact payloads, commands, or snippets shown in Bash commands to install the AI SDK, React AI SDK, OpenAI provider, and Zod using yarn.
examples/prisma-ai-sdk-with-next-js-docs-guides-integrations-prisma-ai-sdk-nextjs-34.bashA bash command to install the AI SDK, React AI SDK, OpenAI provider, and Zod using the Bun package manager.Exact payloads, commands, or snippets shown in A bash command to install the AI SDK, React AI SDK, OpenAI provider, and Zod using the Bun package manager.
examples/prisma-ai-sdk-with-next-js-docs-guides-integrations-prisma-ai-sdk-nextjs.textA text file containing the required environment variable configuration for the Prisma AI SDK integration with Next.js.Exact payloads, commands, or snippets shown in A text file containing the required environment variable configuration for the Prisma AI SDK integration with Next.js.
examples/prisma-ai-sdk-with-next-js-docs-guides-integrations-prisma-ai-sdk-nextjs-35.bashBash commands to create the directory structure and route files for a Next.js AI SDK integration.Exact payloads, commands, or snippets shown in Bash commands to create the directory structure and route files for a Next.js AI SDK integration.
examples/prisma-ai-sdk-with-next-js-docs-guides-integrations-prisma-ai-sdk-nextjs-2.tsxA Next.js route handler implementation using the Prisma AI SDK and OpenAI to stream text responses.Exact payloads, commands, or snippets shown in A Next.js route handler implementation using the Prisma AI SDK and OpenAI to stream text responses.
examples/prisma-ai-sdk-with-next-js-docs-guides-integrations-prisma-ai-sdk-nextjs-3.tsxA Next.js route handler implementation using the Prisma AI SDK and OpenAI to stream text responses.Exact payloads, commands, or snippets shown in A Next.js route handler implementation using the Prisma AI SDK and OpenAI to stream text responses.
examples/prisma-ai-sdk-with-next-js-docs-guides-integrations-prisma-ai-sdk-nextjs-36.bashA bash command to create the lib/save-chat.ts file for the Prisma AI SDK integration with Next.js.Exact payloads, commands, or snippets shown in A bash command to create the lib/save-chat.ts file for the Prisma AI SDK integration with Next.js.
examples/prisma-ai-sdk-with-next-js-docs-guides-integrations-prisma-ai-sdk-nextjs-4.tsxA TypeScript React component function demonstrating how to save chat messages using the Prisma AI SDK within a Next.js application.Exact payloads, commands, or snippets shown in A TypeScript React component function demonstrating how to save chat messages using the Prisma AI SDK within a Next.j...
examples/prisma-ai-sdk-with-next-js-docs-guides-integrations-prisma-ai-sdk-nextjs-5.tsxA TypeScript React component function demonstrating how to use Prisma to upsert a chat session when integrating with the AI SDK in a Next.js application.Exact payloads, commands, or snippets shown in A TypeScript React component function demonstrating how to use Prisma to upsert a chat session when integrating with...
examples/prisma-ai-sdk-with-next-js-docs-guides-integrations-prisma-ai-sdk-nextjs-6.tsxA TypeScript React component function demonstrating how to upsert a session and save chat messages to a database using the Prisma client.Exact payloads, commands, or snippets shown in A TypeScript React component function demonstrating how to upsert a session and save chat messages to a database usin...
examples/prisma-ai-sdk-with-next-js-docs-guides-integrations-prisma-ai-sdk-nextjs-37.bashBash commands to create the directory structure and route file for a Next.js API route used with the Prisma AI SDK.Exact payloads, commands, or snippets shown in Bash commands to create the directory structure and route file for a Next.js API route used with the Prisma AI SDK.
examples/prisma-ai-sdk-with-next-js-docs-guides-integrations-prisma-ai-sdk-nextjs-7.tsxA Next.js API route handler that fetches and formats chat messages from a Prisma database for use with the AI SDK.Exact payloads, commands, or snippets shown in A Next.js API route handler that fetches and formats chat messages from a Prisma database for use with the AI SDK.
examples/prisma-ai-sdk-with-next-js-docs-guides-integrations-prisma-ai-sdk-nextjs-8.tsxA Next.js client component demonstrating the integration of the Prisma AI SDK within a page component.Exact payloads, commands, or snippets shown in A Next.js client component demonstrating the integration of the Prisma AI SDK within a page component.
examples/prisma-ai-sdk-with-next-js-docs-guides-integrations-prisma-ai-sdk-nextjs-9.tsxA Next.js client component demonstrating the implementation of a chat interface using the Prisma AI SDK and the useChat hook.Exact payloads, commands, or snippets shown in A Next.js client component demonstrating the implementation of a chat interface using the Prisma AI SDK and the useCh...
examples/prisma-ai-sdk-with-next-js-docs-guides-integrations-prisma-ai-sdk-nextjs-10.tsxA Next.js client component implementing a chat interface using the Prisma AI SDK and a custom useChat hook.Exact payloads, commands, or snippets shown in A Next.js client component implementing a chat interface using the Prisma AI SDK and a custom useChat hook.
examples/prisma-ai-sdk-with-next-js-docs-guides-integrations-prisma-ai-sdk-nextjs-11.tsxA Next.js client component implementing a chat interface using the Prisma AI SDK and a custom useChat hook.Exact payloads, commands, or snippets shown in A Next.js client component implementing a chat interface using the Prisma AI SDK and a custom useChat hook.
examples/prisma-ai-sdk-with-next-js-docs-guides-integrations-prisma-ai-sdk-nextjs-12.tsxA Next.js client component implementing a chat interface using the Prisma AI SDK and a custom useChat hook.Exact payloads, commands, or snippets shown in A Next.js client component implementing a chat interface using the Prisma AI SDK and a custom useChat hook.
examples/prisma-ai-sdk-with-next-js-docs-guides-integrations-prisma-ai-sdk-nextjs-38.bashThe bash command used to start the development server for the Prisma AI SDK with Next.js integration.Exact payloads, commands, or snippets shown in The bash command used to start the development server for the Prisma AI SDK with Next.js integration.
examples/prisma-ai-sdk-with-next-js-docs-guides-integrations-prisma-ai-sdk-nextjs-39.bashThe bash command used to run the development server for the Prisma AI SDK with Next.js integration.Exact payloads, commands, or snippets shown in The bash command used to run the development server for the Prisma AI SDK with Next.js integration.
examples/prisma-ai-sdk-with-next-js-docs-guides-integrations-prisma-ai-sdk-nextjs-40.bashThe bash command used to start the development server for the Prisma AI SDK with Next.js integration.Exact payloads, commands, or snippets shown in The bash command used to start the development server for the Prisma AI SDK with Next.js integration.
examples/prisma-ai-sdk-with-next-js-docs-guides-integrations-prisma-ai-sdk-nextjs-41.bashThe bash command used to run the development server for the Prisma AI SDK with Next.js integration.Exact payloads, commands, or snippets shown in The bash command used to run the development server for the Prisma AI SDK with Next.js integration.
examples/prisma-ai-sdk-with-next-js-docs-guides-integrations-prisma-ai-sdk-nextjs-42.bashA bash command to launch Prisma Studio for managing database data during AI SDK integration.Exact payloads, commands, or snippets shown in A bash command to launch Prisma Studio for managing database data during AI SDK integration.
examples/prisma-ai-sdk-with-next-js-docs-guides-integrations-prisma-ai-sdk-nextjs-43.bashA bash command to run Prisma Studio using pnpm dlx.Exact payloads, commands, or snippets shown in A bash command to run Prisma Studio using pnpm dlx.
examples/prisma-ai-sdk-with-next-js-docs-guides-integrations-prisma-ai-sdk-nextjs-44.bashA bash command to launch Prisma Studio using the yarn dlx runner.Exact payloads, commands, or snippets shown in A bash command to launch Prisma Studio using the yarn dlx runner.
examples/prisma-ai-sdk-with-next-js-docs-guides-integrations-prisma-ai-sdk-nextjs-45.bashA bash command to run Prisma Studio using the Bun runtime for the Prisma AI SDK integration.Exact payloads, commands, or snippets shown in A bash command to run Prisma Studio using the Bun runtime for the Prisma AI SDK integration.

What This Skill Covers

    • Datadog: Learn how to configure Datadog tracing for a Prisma ORM project. Capture spans for every query using the @prisma/instrumentation package, dd-trace...
  • Main sections: Related pages.

Workflow

  1. Open the most relevant file under docs/ for the exact documented workflow and wording.
  2. Open schemas/ files for exact structured contracts.
  3. Open examples/ files for concrete requests, commands, snippets, and manifests.
  4. Do not add behavior or configuration that is not present in the attached source files.

Canonical source: https://www.prisma.io/docs/guides/integrations/ai-sdk