Edge Functions Highlights
Deploy custom HTTP handlers powered by WebAssembly.
With Edge Functions, you can deploy custom WebAssembly components that handle HTTP requests at specific paths, directly at the edge. Whether you want to create API endpoints, custom authentication, or API integrations, Edge Functions run closer to your users for better performance.
How to enable Edge Functions?
After creating your project, you can start deploying Edge Functions that handle specific paths on your website.
First, enable Edge Functions for your project by visiting the Components panel on your project page, and click Add a Component. Then select Edge Functions from the available components and configure it.
Go to your project > Components, then add an Edge Function.
How does it work?
Edge Functions are WebAssembly components that intercept HTTP requests at specific paths before they reach your backend. When a client visits a configured path, your Edge Function executes at the edge location closest to the user.
Your Edge Function can:
- Handle API requests at specific paths (e.g.,
/api/weather
) - Process data before sending responses
- Generate custom responses without hitting your backend
- Implement authentication logic for protected routes
Path Configuration
Edge Functions can be configured to handle different path patterns:
- Exact path matching: Handle requests to
/api/weather
only - Path prefix matching: Handle all requests starting with
/api/
Configure path matching in your Edge Function settings.