Edge Handlers Early Access

Fast, personalized web experiences. Run custom code right from the network edge with incredible performance. A seamless part of your Netlify development workflow.

Serve dynamic, personalized content instantly

Supercharge your web apps with custom javascript logic that runs on the network edge. Modify each request to localize content, serve relevant banner ads, authenticate visitors, and more... all directly from the worldwide location closest to each user.

Simplify A/B testing

Write logic that splits visitors across multiple versions of content or even transform content right in the request—all without having to coordinate across teams and codebases.

Personalize ads

Deliver higher converting ads that automatically tailor content based on each user’s location and other details such as cookies or authentication tokens.

Customize authentication

Deliver fast, customized authentication with credentials cached and verified at the edge.

Aggregate APIs

Logic that used to require many rewrite rules can now be simplified into a single function with the full expressive power of JavaScript. Edge Handlers can even fetch and cache data from external endpoints.

Localize content

Populate local language and branding into your website using the available Geolocation API.

Easily push site-wide changes

From a simple CSS change to an announcement banner, Edge Handlers can inject and transform elements directly with every html response. Deploy sitewide changes without having to rebuild the site.

A seamless part of Netlify’s development workflow

Develop edge logic that makes your web experiences more customized and more powerful— using the tools you love and without having to coordinate with teams of network architects and SREs

A frontend workflow that does much more

Use Netlify's git-based workflow and the tooling that your team already knows to build, preview, and deploy Edge Handlers right alongside your web apps and sites. During each build, Netlify will automatically discover your handlers, bundle any required dependencies, and deploy them to the edge.

Add to cart Light Roast bb1147f https://newstore-branch--www.jamjava.com Deploy preview for www ready!Built with commit netlify BOT commented 3 hours ago
Netlify automatically adds preview links right in Github
export function onRequest(event) { const { code } = event.request.origin.country; if (code === "US") { const { code: state } = event.request.origin.subdivision; let url = new URL(event.request.url); url.pathname = `/state/${state ? state.toLowerCase() : "ca"}`; event.replaceResponse(() => fetch(url.toString())); } }

Customize the edge, with a powerful API

The Edge Handlers API can fetch, cache, and manipulate content at the edge, so you can deliver a fast, personalized experience with minimal development work.

Coming soon Validate locally, before pushing live

Create and test Edge Handlers on your local machine or with Netlify development tools. Then use any frontend framework to proxy requests and test the behavior before you ship.

npm install netlify-cli -g netlify dev # Install the Netlify CLI # Start Netlify dev
starting edge handler... X-N-F City Name: Austin Executed successfully in 15ms Handlers log Copy to clipboard 2 handlers actively running in . production Edge Handlers Beta

Monitor and log activity

Detailed logs for Edge Handlers can be managed and viewed from within the Netlify UI, making it easy to track usage and resolve issues quickly.

How it works

NETLIFY EDGE CLIENT
  1. Create Edge Handlers as server-side code that run on every node in Netlify's Edge network.
  2. Edge Handlers intercept inbound requests from the client or the response from the edge network.
  3. Your custom logic is executed with the full context of the request available to your programs, including user identity (when users are authenticated), cookie settings, and geographical location.

Request Access

Netlify Edge Handlers is in early access.
Request access and tell us a little about your project

Sign up for more details

FAQ

How is Edge Handlers different from Netlify Functions

Netlify Functions and Netlify Edge Handlers are very similar - both execute your custom code to bring more dynamic functionality to your websites and web apps. Both can be bundled via Netlify CLI or your own bundling tool. However, there are a few key differences.

First, they're invoked differently. Netlify Functions is invoked by the client using client-side Javascript referencing a URL endpoint. Whereas Edge Handlers is invoked upon request. Second, Edge Handlers have much lower latency. It's executed at the network edge and doesn't have to wake a machine to run.

How is Edge Handlers different from "Workers" offerings from others?

Netlify Edge Handlers is very similar to "Workers", but with a fundamentally difference that it was designed from the start to operate as a part of Netlify's end-to-end development workflow:

  • Development experience - it works with any frontend framework, and it fully integrated into Netlify's developer tooling
  • Connected workflow - Edge Handlers are built, deployed and managed right next to your web properties. It's one workflow and doesn't require coordination across countless tools and teams
  • Local testing and validation - With other solutions, it's nearly impossible to reason about how it works, when it works, and how to program it. Edge Handlers let's you build and test the behavior before it goes live
  • Seamless deployment - Edge handlers can be written and deployed right from your project directory.
How much does Edge Handlers cost

During Early Access, Edge Handlers is free to use! We'll announce pricing as we move to General Availability

What Netlify plans include Edge Handlers?

During Early Access, Edge Handlers is free to use on every Netlify plan, even the Starter plan. This will likely change once the product is Generally Available.