:wave: Hey quick question on using Prisma with nex...
# orm-help
y
👋 Hey quick question on using Prisma with nextjs. I see a lot of examples using the PrismaClient directly in getServerSideProps. I am wondering how this is secure since getServerSideProps is sometime ran on the client side. Doesnt this mean our DB is exposed on the frontend?
e
According to NextJS doc,
getServerSideProps
is only ever run on the server: https://nextjs.org/docs/basic-features/data-fetching#only-runs-on-server-side So I think in this case, it should be ok 🙂 . Did you encounter a case where
getServerSideProps
is run on the client?
r
@Yucheng 👋
getServerSideProps
is never run on the client so you do not need to worry about your database being exposed to the frontend.
y
Ahhh gotcha, i got it confused with getInitialProps, thanks!
👍 1