Using Vercel Edge functions instead of Supabase's

So, not sure if the title gave it away, but I'm kinda lost on this topic. My app's auth provider isn't playing nice with Supabase's Database. I stumbled upon a fix that involves signing my own JWT with Supabase's key but I have to do it on the server. The person who shared this gem used Supabase's Edge Functions to make it happen. But here's the snag: using Supabase CLI means dealing with Docker Desktop, and my system just can't handle it. Also, you can't create Edge functions on the Supabase Dashboard, which adds another layer of complexity. Now, since this signing thing has to happen on the server, I'm thinking maybe I can use a React Server Component (RSC) since I'm on Next.js 13. Problem is, I'm using the Pages Router, and RSCs don't vibe with that. Not even sure if RSCs are the answer. Then, I remembered Next.js and Vercel have their own Edge Functions. Can I just roll with those to sort this mess out?"
4 Replies
garyaustin
garyaustin2y ago
Both are based on Deno I believe so should have similar functionality. You give up the built in environment variables and would use fetch to call them from the client.
vick
vick2y ago
Vercel edge is not deno, it is v8 isolates. Supabase works just fine in both vercel edge and regular node functions. I only use them via Nextjs but that's just a convenience.
garyaustin
garyaustin2y ago
Yep. I was thinking of Netlify...
Nonso
NonsoOP2y ago
Thanks for the help !!!!

Did you find this page helpful?