Newsletter
Join the Community
Subscribe to our newsletter for the latest news and updates
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 is a Vercel example template built with Next.js that demonstrates three approaches to purchase power parity (PPP) pricing — at the edge via the request geolocation object, through Node.js server-side rendering, and with client-side rendering — so developers can see the differences in one codebase.
This template is a live demonstration from the Vercel examples repository. It takes a visitor's geolocation, derived from the incoming request at the edge, and uses it to adjust the price of a product shown on a Next.js page. The same pricing logic is implemented three ways — edge middleware, Node.js SSR, and client-side rendering — so you can compare their behavior directly. It runs on Next.js with Tailwind CSS styling and is maintained by Vercel as an open-source example.
pnpm create next-app --example https://github.com/vercel/examples/tree/main/edge-middleware/power-parity-pricing-strategies power-parity-pricing-strategies and run pnpm dev to inspect the code locally.Clone the repository with create-next-app (or use the one-click deploy button), then run pnpm dev locally. The code implements the pricing logic in three places: middleware that runs at the edge, a server-side rendered page, and a client-side script. The live demo at edge-mug.vercel.app shows the result for each strategy.
Purchase power parity (PPP) pricing adjusts a product's price in a given country to reflect that country's purchasing power, so the same product costs a different amount depending on the visitor's location.
You can deploy with the one-click Vercel button, which clones the repository and sets up the project, or clone it locally with pnpm create next-app --example https://github.com/vercel/examples/tree/main/edge-middleware/power-parity-pricing-strategies power-parity-pricing-strategies, then run pnpm dev and push to Vercel.
Yes, the template is part of the open-source Vercel examples repository, so it is free to copy, modify, and deploy.
The edge approach reads geolocation from the request object and runs the price calculation near the user. Node.js SSR computes the price on the server during rendering. Client-side rendering performs the calculation in the browser.
