Hello, can I use getServiceSupabase in next.js mid...
# help
a
Hello, can I use getServiceSupabase in next.js middleware? Would that be safe?
Copy code
ts
export const getServiceSupabase = () =>
  createClient(
    process.env.NEXT_PUBLIC_SUPABASE_URL,
    process.env.SUPABASE_SERVICE_ROLE_KEY
  )
n
Hello @arcavid! This thread has been automatically created from your message in #843999948717555735 a few seconds ago. We have already mentioned the @User so that they can see your message and help you as soon as possible! Want to unsubscribe from this thread? Right-click the thread in Discord (or use the ``...`` menu) and select "Leave Thread" to unsubscribe from future updates. Want to change the title? Use the ``/title`` command! We have solved your problem? Click the button below to archive it.
o
Hi You can indeed, it's probably safe enough, but i would recommand you to use the NextJs helper https://github.com/supabase-community/supabase-auth-helpers/blob/main/src/nextjs/README.md @arcavid
n
arcavid (2022-05-10)
a
Thanks!