Back to templates

Template details

Power Parity Pricing

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

About this template

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.

What is Power Parity Pricing?

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.

Key Features

  • Edge Middleware geolocation — Determines the user's country from the request geolocation object at the edge, with no client-side scripts or extra round trips.
  • One-click deployment — Deploy directly to Vercel using the provided Vercel button, which pre-fills the repository URL and project name.
  • Clone-and-deploy workflow — Bootstrap a local copy with pnpm create next-app --example and run it in development mode with pnpm dev.
  • Tailwind CSS styling — The interface is styled with Tailwind CSS, a utility-first CSS framework.
  • Related strategy templates — Bundled with sibling examples for A/B testing (ab-testing-simple) and alternative PPP strategies, allowing you to compare approaches.
  • Production-grade starter — Served as part of Vercel's official examples collection, which is designed to be used as a foundation for your own applications.

Who is it for?

  • E-commerce developers — Use the example to implement country-specific pricing for a global storefront without standing up dedicated price tables.
  • SaaS and subscription platforms — Adjust plan or subscription prices per country to match local purchasing power while keeping a single codebase.
  • Next.js developers — Learn how to read request metadata in Edge Middleware by studying a small, working example that you can extend.
  • Global digital product teams — Prototype a PPP feature quickly and then deploy it to production with Vercel's one-click flow.

What can you do with it?

  • Show localized prices on landing pages: Replace a static price with one that reflects the visitor's country, making the offer more accessible to lower-income markets.
  • Run a live demo: Explore the deployed demo to see how the same URL renders different prices for different geographies.
  • Extend the PPP logic: Use the related strategies template to experiment with alternative calculation methods and pick the one that fits your product.
  • Compare middleware patterns: Pair the example with the A/B testing template to combine price localization with experiment-driven price changes.

How does it work?

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.

FAQ

Is Power Parity Pricing free?

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.

What does Power Parity Pricing do?

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.

How do I deploy Power Parity Pricing?

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.

Does it use client-side JavaScript for geolocation?

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.

What stack does it use?

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.

screenshot of Power Parity Pricing on template0.com