Closed Innders closed 11 months ago
For your points 1 through 3, supabase edge functions don’t have direct access to the database, you have to connect to them using supabase js. They are essentially Deno edge functions. So, it doesn’t matter vercel or supabase functions.
For your point 4, vercel doesn’t have unlimited serverless functions. It might actually be cheaper to run Supabase edge functions for this purpose.
For point 5, check out Supabase wrappers.
Okay so all my points were misconceptions... That was exactly the clarification and correction I was looking for, so thanks! 🙏
Discussion
Both NextJs and Supabase have serverless functions that allow you to catch Stripe webhooks and sync Supabase with your products, prices and subscriptions.
But why specifically does this template use NextJs routes? It may purely be because this is a NextJs repo and it's good to see examples built using the technology and nothing deeper than that.
However I have put together a pros and cons list for using Supabase instead and would love to know everyones thoughts.
PROS and CONS for moving Stripe webhook functions to Supabase.
These are the main points I can think of based off my research, but please correct me if I'm wrong and add to it!
Thanks