Skip to content

add docs for vercel marketplace #6773

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion content/250-postgres/1100-integrations/100-netlify.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ The [Netlify extension for Prisma Postgres](https://www.netlify.com/integrations

### Install the extension

To install the extension, click **Install** at the top of the [Prisma Postgres extensions page](https://www.netlify.com/integrations/prisma).
To install the extension, click **Install** at the top of the [Prisma Postgres extension page](https://www.netlify.com/integrations/prisma).

### Add the Prisma Platform integration token to your Netlify team

Expand Down
90 changes: 89 additions & 1 deletion content/250-postgres/1100-integrations/200-vercel.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,92 @@

## Vercel

The Prisma Postgres integration for Vercel Marketplace is coming soon.
The [Vercel Marketplace integration for Prisma Postgres](https://www.vercel.com/marketplace/prisma) connects your Vercel projects with Prisma Postgres instances. Once connected, the integration will automatically set the `DATABASE_URL` environment variable on your deployed Vercel app.

## Features

- Create and use Prisma Postgres instances without leaving the Vercel dashboard.
- Automatic generation of Prisma Postgres URLs keys for production and preview environments.
- Simplified environment configuration for your Vercel project.
- Billing workflows to up-/ and downgrade your Prisma Postgres pricing plan.
- Ready-to-deploy fullstack Next.js [template](https://www.vercel.com/templates/tbd) with authentication.

Check failure on line 20 in content/250-postgres/1100-integrations/200-vercel.mdx

View workflow job for this annotation

GitHub Actions / Linkspector

[linkspector] content/250-postgres/1100-integrations/200-vercel.mdx#L20

Cannot reach https://www.vercel.com/templates/tbd. Status: 404
Raw output
message:"Cannot reach https://www.vercel.com/templates/tbd. Status: 404" location:{path:"content/250-postgres/1100-integrations/200-vercel.mdx" range:{start:{line:20 column:37} end:{line:20 column:85}}} severity:ERROR source:{name:"linkspector" url:"https://github.com/UmbrellaDocs/linkspector"}

## Usage

> **Note**: The easiest way to use the Prisma Postgres extension is via the [Next.js Auth Template](https://www.vercel.com/templates/tbd).

Check failure on line 24 in content/250-postgres/1100-integrations/200-vercel.mdx

View workflow job for this annotation

GitHub Actions / Linkspector

[linkspector] content/250-postgres/1100-integrations/200-vercel.mdx#L24

Cannot reach https://www.vercel.com/templates/tbd. Status: 404
Raw output
message:"Cannot reach https://www.vercel.com/templates/tbd. Status: 404" location:{path:"content/250-postgres/1100-integrations/200-vercel.mdx" range:{start:{line:24 column:77} end:{line:24 column:138}}} severity:ERROR source:{name:"linkspector" url:"https://github.com/UmbrellaDocs/linkspector"}

### Install the extension

To install the extension, click **Install** at the top of the [Prisma Postgres integration page](https://www.vercel.com/marketplace/prisma).

The integration will now show up on your list of integrations, e.g. `https://vercel.com/<VERCEL-TEAM>/~/integrations`.

### Create a new database

Once installed, you can navigate to the **Storage** tab and click **Create Database**.

Select **Prisma Postgres** and click **Continue**. Then select the **Region** for the database and a **Pricing Plan**, and click **Continue** again.

Finally, give the database a **Name** and click **Create**.

The database is now ready and can be connected to your Vercel projects.

### Connect database to Vercel project

In your Vercel project, you can now click the **Storage** tab, select the database you just created and then click **Connect**. This will automatically set the `DATABASE_URL` environment variable in that project and enable your application to access your newly created Prisma Postgres instance.

### Viewing and editing data in Prisma Studio

To view and edit the data in your Prisma Postgres instance, you can use the local version of [Prisma Studio](/orm/tools/prisma-studio).

In the local version of your project where you have your `DATABASE_URL` set, run the following command to open Prisma Studio:

```terminal
npx prisma studio
```

## Additional considerations

### Ensure your project uses the `DATABASE_URL` environment variable

Ensure that the data source in your `schema.prisma` file is configured to use the `DATABASE_URL` environment variable:

```prisma
// schema.prisma
generator client {
provider = "prisma-client-js"
}

datasource db {
provider = "postgresql"
url = env("DATABASE_URL")
}
```

### Generate Prisma Client in a `postinstall` script in `package.json`

To ensure the generated Prisma Client library is available on your deployed Vercel project, you should add a `postinstall` script to the `scripts` section of your `package.json` file:

```js file=package.json
{
// ...
"scripts": {
// ...
// add-next-line
"postinstall": "prisma generate --no-engine"
}
//
}
```

The `--no-engine` flag ensures that the query engine binary is kept out of the generated Prisma Client library. It's not needed when using Prisma Postgres.

## Example: Deploy a Next.js template with Prisma Postgres

To get started you can deploy our [Next.js starter template](https://www.vercel.com/templates/tbd) and connect via Prisma Postgres instance during the deployment flow.

Check failure on line 94 in content/250-postgres/1100-integrations/200-vercel.mdx

View workflow job for this annotation

GitHub Actions / Linkspector

[linkspector] content/250-postgres/1100-integrations/200-vercel.mdx#L94

Cannot reach https://www.vercel.com/templates/tbd. Status: 404
Raw output
message:"Cannot reach https://www.vercel.com/templates/tbd. Status: 404" location:{path:"content/250-postgres/1100-integrations/200-vercel.mdx" range:{start:{line:94 column:35} end:{line:94 column:99}}} severity:ERROR source:{name:"linkspector" url:"https://github.com/UmbrellaDocs/linkspector"}

<!-- This section contains step-by-step instructions for deploying a fullstack Next.js app and connecting it to Prisma Postgres from scratch using the official [Vercel template for Next.js & Prisma Postgres](https://www.vercel.com/templates/tbd) template.

### 1. Deploy the template

Navigate to the [template on vercel.com/templates](https://www.vercel.com/templates/tbd) and click **Deploy**. -->
Loading