DEV Community

Alex Spinov
Alex Spinov

Posted on

Supabase Edge Functions Has a Free API — Deploy Deno Functions Globally

What if your Supabase project included serverless functions — running on Deno at the edge, with direct access to your database?

Supabase Edge Functions lets you deploy TypeScript functions that run close to your users worldwide.

Why Supabase Edge Functions

  • Deno runtime — modern TypeScript, web standard APIs
  • Direct DB access — query your Supabase database without REST
  • Edge deployment — low latency globally
  • Built into Supabase — no separate hosting to manage
  • Free tier — 2M invocations/month

Quick Start

supabase functions new hello-world
Enter fullscreen mode Exit fullscreen mode
// supabase/functions/hello-world/index.ts
import { createClient } from "https://esm.sh/@supabase/supabase-js";

Deno.serve(async (req) => {
  const supabase = createClient(
    Deno.env.get("SUPABASE_URL")!,
    Deno.env.get("SUPABASE_SERVICE_ROLE_KEY")!
  );

  const { data, error } = await supabase
    .from("users")
    .select("*")
    .limit(10);

  return new Response(JSON.stringify(data), {
    headers: { "Content-Type": "application/json" },
  });
});
Enter fullscreen mode Exit fullscreen mode

Deploy:

supabase functions deploy hello-world
Enter fullscreen mode Exit fullscreen mode

Use Cases

  • Webhooks — process Stripe, GitHub, or custom webhooks
  • Custom auth — complex authorization logic beyond RLS
  • AI/LLM — call OpenAI/Anthropic with server-side API keys
  • Email/SMS — send notifications via SendGrid, Twilio
  • Data transformation — ETL pipelines triggered by database changes

Real Use Case

A SaaS needed to process Stripe webhooks. Instead of setting up a separate Express server, they deployed one Edge Function. It verified the webhook signature, updated the database, and sent a confirmation email — all in 40 lines of TypeScript, deployed in under a minute.

Get Started

Visit supabase.com/docs/guides/functions — part of every Supabase project.


Need custom data pipelines or scraping solutions? Check out my Apify actors or email me at spinov001@gmail.com for custom solutions.

Top comments (0)