Skip to content
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

doc(prisma): add edge compatibility section #9965

Closed
wants to merge 2 commits into from

Conversation

ThangHuuVu
Copy link
Member

Add the edge compat section for Prisma

@ThangHuuVu ThangHuuVu requested a review from ndom91 as a code owner February 8, 2024 16:43
Copy link

vercel bot commented Feb 8, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
auth-docs ❌ Failed (Inspect) Feb 10, 2024 0:26am
2 Ignored Deployments
Name Status Preview Comments Updated (UTC)
next-auth-docs ⬜️ Ignored (Inspect) Visit Preview Feb 10, 2024 0:26am
nextra-docs ⬜️ Ignored (Inspect) Visit Preview Feb 10, 2024 0:26am

@github-actions github-actions bot added adapters Changes related to the core code concerning database adapters prisma @auth/prisma-adapter labels Feb 8, 2024
Comment on lines +182 to +185
* import { PrismaAdapter } from "@auth/prisma-adapter"
*
* export const { handlers, auth, signIn, signOut, unstable_update } = NextAuth({
* adapter: PrismaAdapter(globalThis.prisma),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* import { PrismaAdapter } from "@auth/prisma-adapter"
*
* export const { handlers, auth, signIn, signOut, unstable_update } = NextAuth({
* adapter: PrismaAdapter(globalThis.prisma),
* import { PrismaAdapter } from "@auth/prisma-adapter"
* import { PrismaClient } from "@prisma/client"
*
* globalThis.prisma ??= new PrismaClient()
*
* export const { handlers, auth, signIn, signOut, unstable_update } = NextAuth({
* adapter: PrismaAdapter(globalThis.prisma),

Comment on lines +162 to +164
* At the moment, Prisma is still working on being fully compatible with the Vercel edge runtime. See the issue being tracked [here](https://github.com/prisma/prisma/issues/20560). There are two options to deal with this issue:
* - Use the Prisma's [Accelerate plan](https://pris.ly/d/accelerate)
* - Switch to the `jwt` session strategy. Below is an example:
Copy link
Member

@ndom91 ndom91 Feb 8, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* At the moment, Prisma is still working on being fully compatible with the Vercel edge runtime. See the issue being tracked [here](https://github.com/prisma/prisma/issues/20560). There are two options to deal with this issue:
* - Use the Prisma's [Accelerate plan](https://pris.ly/d/accelerate)
* - Switch to the `jwt` session strategy. Below is an example:
* At the moment, Prisma is still working on being fully compatible with the Vercel edge runtime. See the issue being tracked [here](https://github.com/prisma/prisma/issues/20560), and Prisma’s announcement about edge support in early access since 5.9.0 [here](https://github.com/prisma/prisma/releases/tag/5.9.0). There are two options to deal with this issue:
*
* - Use the Prisma’s [Accelerate](https://pris.ly/d/accelerate) feature
* - Switch to the `jwt` session strategy
*
* Using Prisma in and edge runtime with `jwt` session strategy looks like this.

@ndom91
Copy link
Member

ndom91 commented Feb 8, 2024

Small tweaks otherwise lgtm!

@ThangHuuVu
Copy link
Member Author

Shouldn't be necessary for Prisma v5.9.1 or higher anymore

@ThangHuuVu ThangHuuVu closed this Feb 12, 2024
@ndom91 ndom91 deleted the doc/prisma-edge-compat branch September 15, 2024 18:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
adapters Changes related to the core code concerning database adapters prisma @auth/prisma-adapter
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants