Can I connect to Supabase Postgres from serverless and edge functions?

Yes, though the connection methods vary:

  • For Vercel Edge functions, follow the guidelines in the Supabase docs
  • For Cloudflare Workers, follow the Cloudflare’s guidelines to set up Supabase.
  • For other serverless providers, connect through the shared pooler rather than directly. Serverless platforms open many short-lived connections to your Postgres instance, which can overload the available connections.

For more detailed guidance, see Serverless drivers.