Supabase Edge Functions Has Free Serverless Deno Functions
You have a Supabase project. You need server-side logic. You dont want to set up a whole backend. Edge Functions solve this in 30 seconds.
What Edge Functions Are
Supabase Edge Functions are serverless TypeScript/Deno functions that run on Deno Deploy's global edge network:
- Deno runtime — TypeScript first-class, no build step
- 500K invocations/month free — generous for most projects
- Global edge — runs close to your users
- Full Supabase access — database, auth, storage from functions
- Secrets management — env vars via CLI
Quick Start
# Create a function
supabase functions new hello-world
# Write the function
cat > supabase/functions/hello-world/index.ts << EOF
import { serve } from "https://deno.land/std/http/server.ts"
import { createClient } from "https://esm.sh/@supabase/supabase-js@2"
serve(async (req) => {
const supabase = createClient(
Deno.env.get("SUPABASE_URL")!,
Deno.env.get("SUPABASE_ANON_KEY")!
)
const { data } = await supabase.from("users").select("*").limit(10)
return new Response(JSON.stringify(data), {
headers: { "Content-Type": "application/json" }
})
})
EOF
# Deploy
supabase functions deploy hello-world
Free Tier
| Resource | Free | Pro ($25/mo) |
|---|---|---|
| Invocations | 500K/month | 2M/month |
| Execution Time | 150s max | 150s max |
| Memory | 256MB | 256MB |
| Payload | 6MB | 6MB |
Use Cases
- Webhooks — process Stripe, GitHub, or any webhook
- Cron jobs — scheduled tasks via pg_cron + Edge Functions
- API routes — custom endpoints with auth validation
- AI/ML — call OpenAI, Anthropic APIs with server-side keys
- Email sending — trigger emails on database events
Why Edge Functions Over Alternatives
- No separate infra — lives in your Supabase project
- Deno = modern — top-level await, TypeScript, Web APIs
- Row Level Security — access Supabase with service role key
-
Local dev —
supabase functions servewith hot reload
Building serverless apps with Supabase? I help teams architect full-stack apps with Edge Functions, Auth, and Realtime.
📧 spinov001@gmail.com — Supabase consulting and setup
Follow for more developer tool guides.
Top comments (0)