# Edge Functions are now available in Supabase

[Supabase](https://yomu.fyi/company/supabase) · Inian Parameshwaran · Mar 31, 2022

**Type:** Announcement

## Summary

Supabase launched Edge Functions to execute TypeScript code close to end-users across more than 30 data centers. Built on the secure-by-default Deno runtime and hosted via Deno Deploy, the feature offers fast start-ups, scale-to-zero pricing, and native support for npm modules and Node built-in APIs. Incoming requests first reach an API gateway called Relay, which authenticates JSON Web Tokens, handles rate-limiting, and forwards requests using a Deployment ID to Deno Deploy. Observability is handled through Logflare to feed structured logs and metrics directly into the Supabase Dashboard. To mitigate abuse risks experienced during earlier product rollouts, invocations are currently limited to POST requests rather than general website hosting.

## Context

Developers needed a way to run serverless business logic close to end-users with fast startup times and low operational overhead, distinct from database-colocated functions.

## Approach / What changed

Supabase built Edge Functions using the Deno runtime and Deno Deploy, routing requests through an authenticating Relay layer and streaming metrics via Logflare.

## Takeaways

- Deno Deploy provides local-to-production parity because open-source Deno CLI tools match the behavior of the proprietary hosted platform.
- An internal Relay serves as an API gateway to authenticate JWTs, rate-limit traffic, and construct Deployment IDs for Deno Deploy.
- To avoid the security risks and Safe Browsing denylisting associated with general web hosting, Edge Functions are restricted to POST invocations.

**Tags:** [Architecture](https://yomu.fyi/topic/architecture), [Developer Experience](https://yomu.fyi/topic/developer-experience), [Observability](https://yomu.fyi/topic/observability), [Serverless](https://yomu.fyi/topic/serverless), [TypeScript](https://yomu.fyi/topic/typescript)

[Read original post](https://supabase.com/blog/supabase-edge-functions)
