Skip to content

Vercel Edge Middleware examples

Browse examples of how to use and apply Vercel Edge Middleware.

Optimizely Feature Experimentation

Fast and safe experimentation with Next.js App Router, Vercel Feature Flags, and Optimizely Feature Experimentation
Optimizely Feature Experimentation

LaunchDarkly Flags SDK Example

Learn how to set up LaunchDarkly, including experimentation alongside Flags SDK and Edge Config.
LaunchDarkly Flags SDK Example

Power Parity Pricing

Implement power parity pricing using information from the request geolocation object in Edge Middleware.
Power Parity Pricing

Adding Response Headers in Edge Middleware

Learn to add response headers at the edge.
Adding Response Headers in Edge Middleware

Split Integration example

Learn to use Split, a feature delivery platform that powers feature flag management, software experimentation and continuous delivery.
Split Integration example

Growthbook Flags SDK Example

Learn how to set up Growthbook flags and experiments using Flags SDK.
Growthbook Flags SDK Example

IP Blocking with Upstash

Template featuring IP Blocking at the edge using Upstash.
IP Blocking with Upstash

Geolocation in Edge Middleware

Learn how to use visitor's location at the edge.
Geolocation in Edge Middleware

Basic Auth Password Protection

Password protect pages in your application using Edge Middleware.
Basic Auth Password Protection

i18n in Edge Middleware

This template shows how to redirect users based on i18n configuration.
i18n in Edge Middleware

Experimentation with Statsig

Reduce CLS and improve performance from client-loaded experiments at the edge with Statsig
Experimentation with Statsig

User-Agent Based Rendering

Learn how to render a different page based on the User-Agent header.
User-Agent Based Rendering

Blue-Green Deployments on Vercel

See how Vercel's Skew Protection feature enables production-ready blue-green deployments with just a few lines of code.
Blue-Green Deployments on Vercel

Bot Detection with Botd

Botd is a browser library for bot detection. In this template we'll be using it alongside botd-integrations for bot detection at the edge.
Bot Detection with Botd

Feature Flags with Optimizely

Learn how to use optimizely to conduct experiments at the edge.
Feature Flags with Optimizely

Maintenance Page

This template shows how to quickly trigger a maintenance page using Edge Config
Maintenance Page

Adding Cookies

Read and write cookies directly at the edge.
Adding Cookies

PostHog with Flags SDK and Next.js

An e-commerce example using static page variants with middleware rewrites determined by Flags SDK and PostHog.
PostHog with Flags SDK and Next.js

Vercel Edge Middleware Rate Limit

Add rate limiting to your application with any frontend framework.
Vercel Edge Middleware Rate Limit

LaunchDarkly Integration example

Learn how to set up the LaunchDarkly integration to read flags from Edge Config
LaunchDarkly Integration example

Next.js Waiting Room

Add a virtual waiting room to your site.
Next.js Waiting Room

Hostname Rewrites using Edge Middleware

Learn how to programmatically create unique content pages for your users with a multi-tenant infrastructure using Edge Middleware.
Hostname Rewrites using Edge Middleware

Power Parity Pricing Strategies

Shows the differences between doing PPP at the edge using information from the geolocation object, Node.js SSR, and client-side rendering.
Power Parity Pricing Strategies

A/B Testing with ConfigCat

ConfigCat is a service for feature flag and configuration management. In this template you'll be able to use feature flags at the edge.
A/B Testing with ConfigCat

IP Blocking with DataDome

DataDome can provide real-time bot protection, ip blocking, custom rules protection and other security protections to any website.
IP Blocking with DataDome

Bot Protection with DataDome

DataDome can provide real-time bot protection and other security protections to any website. In this template we'll be using it at the edge.
Bot Protection with DataDome

Rewriting at the Edge using Upstash

Learn how to avoid calling several services by pre-checking stock at the edge using a redis cache.
Rewriting at the Edge using Upstash

Hypertune Integration example

Learn to use Hypertune, a powerful feature flag, A/B testing, analytics and app configuration platform.
Hypertune Integration example

A/B Testing with Google Optimize

Learn to use Google Optimize as an A/B testing solution for experimentation at the edge.
A/B Testing with Google Optimize

Modifying Request Headers in Middleware

Learn to add/update/delete request headers in a middleware.
Modifying Request Headers in Middleware