Announcing the new Edge Functions Components powered by WebAssembly

Cover Image for Announcing the new Edge Functions Components powered by WebAssembly

Earlier this year we launched the Edgee Component Registry to help developers share and run WebAssembly (Wasm) components at the edge.

Today, we are announcing a new type of component that opens the door for general purpose HTTP handlers - we call them edge function components.

Why edge function components

The typical website has hundreds of static or dynamic pages, as well as API endpoints that handle specific actions such as form submissions or custom integrations. Often, these special endpoints are hosted on a different domain or subdomain such as api.yourwebsite.com, resulting in developer headaches related to CORS (Cross-Origin Resource Sharing), caching behaviours, backend scaling, or path conflicts between multiple origins.

Wouldn't it be great if you could magically map a URL path such as /contact or /send-email to a custom HTTP handler that runs efficiently at the edge, with virtually infinite scalability thanks to hundreds of edge nodes, and without even touching your website code?

And on top of that, what if you could leverage a rich ecosystem of open source and reusable handlers that help you cover common use cases such as sending a Slack message to your team, rendering a custom landing page, or sending transactional emails via SendGrid?

That's exactly why we built edge function components. By reusing existing public components or creating your own private ones, you can add new functionalities and integrations in a blink of an eye.

How it works

Under the hood, all components are compiled into WebAssembly binaries, distributed and executed on top of Edgee's global platform, which spans hundreds of PoPs (Points of Presence) and provides a flexible way to configure URL routes, HTTP methods, and caching.

You can use any language supported by the WebAssembly component model: Rust, Go, C, C#, JavaScript, TypeScript, and Python. The Edgee CLI provides a language-agnostic local development experience that lets you create, compile, test, and push components.

Once a component is available as private or public on the Edgee Component Registry, it can be used on any Edgee project and mapped to a specific URL path (or prefix). In just a few seconds, you get a global deployment across multiple edge and cloud regions to guarantee optimal performance and reliability.

Diagram illustrating the architecture and functionality of edge functions

Whether your component is returning a static response or generating dynamic HTML or JSON responses, you have full control over the end-to-end caching behavior via standard HTTP headers. And you can quickly disable or re-enable each component with a couple of clicks on the Edgee dashboard, giving your team a simple way to monitor, manage, and debug components across all your organizations and projects.

Common use cases

Edge function components can generate any type of HTTP response.

Here are few ideas and common use cases.

Static responses:

  • Maintenance page on a specific path or even the entire website
  • Static landing page for an email campaign
  • Temporary page for A/B testing experiments
  • API mocks as static JSON responses

Dynamic responses:

  • Simple API integrations to send or fetch data from external services
  • Form submission or contact form handlers
  • AI integrations such as website localization or chatbot gateways
  • Custom authorization endpoint (e.g. JWT validation)
  • First-party gateway for third-party APIs
  • Render dynamic HTML after fetching data from a cloud database
  • Webhook handlers

Reusable edge functions available at launch

While private components help you solve challenges specific to your website or domain, you'll also find a set of public and reusable edge functions. Their goal is to serve as a reference implementation for your own private components, while providing a useful set of common functionalities so that you don't have to reinvent the wheel.

Here are the first 3 public edge functions:

  1. Maintenance page component - a static page that you can easily map to the entire website or subpath.
  2. Slack message component - a JSON endpoint accepting POST requests to send Slack messages.
  3. SendGrid component - a JSON endpoint accepting POST requests to send emails via SendGrid.

And you can expect many more reusable edge function components in the future.

How to create your own edge function

You can use the Edgee CLI to create, compile and test your edge functions locally. Because edge functions act as regular HTTP handlers, the Edgee CLI also includes a local HTTP server to easily test HTTP responses via cURL or even directly in your browser.

How to create an edge function component with the Edgee CLI

Learn more about configuring and pushing your own components in our developer guide.

Try it today for free

You can sign up, create edge function components, and experiment for free, starting today.

When adding an edge function component to your Edgee project, generate up to 5 thousand component execution per month with our free tier. Check out the Team and Enterprise plans for higher volumes.

We look forward to learning about what you'll build with edge function components and continue iterating to support more use cases and push new reusable edge function components.

Check out the Edgee Component Registry to learn more about other components for data collection, consent mapping, security, content stitching, and more.

Contact