Newsletter
Join the Community
Subscribe to our newsletter for the latest news and updates
Implement power parity pricing using information from the request geolocation object in Edge Middleware.
Power Parity Pricing is a Next.js example from Vercel that implements power parity pricing (PPP) using the request geolocation object in Edge Middleware to show country-adjusted prices.
Power Parity Pricing is a reference implementation for adjusting prices based on the purchaser's location. It reads the geolocation data attached to each incoming request in Edge Middleware and applies a PPP adjustment to the price displayed to the user. The example runs on Vercel's Edge network using Next.js middleware, with Tailwind CSS for styling. It is published in Vercel's curated examples repository and includes a live demo at https://edge-functions-power-parity-pricing.vercel.app.
pnpm create next-app --example and run it in development mode with pnpm dev.The Edge Middleware intercepts each request before the page loads, reads the geolocation object that Vercel attaches to the request, and uses the country code to compute an adjusted price. The adjusted price is then injected into the page response. Because this runs at the edge, there is no additional latency from a serverless function call.
Yes. The source code is published in Vercel's public examples repository, so you can clone it, modify it, and deploy it to your own Vercel project. The only cost would be your normal Vercel usage for hosting.
It shows different prices to visitors from different countries by reading the request geolocation in Edge Middleware. This lets you align your displayed prices with local purchasing power without requiring users to enter a country or use a geo-IP service.
Use the one-click Deploy with Vercel button, or clone it locally with pnpm create next-app --example, then push to your own repository and import it into Vercel. Both workflows are described in the example's README.
No. The geolocation is read server-side in Edge Middleware from the request object. The client only receives the final adjusted price, making the approach faster and more private.
It uses Next.js as the React framework, Tailwind CSS for utility-based styling, and Vercel's Edge Middleware to run the pricing logic at the network edge. The example is part of Vercel's official examples collection.
