Products sorted alphabetically

    1. Awesome Shoes ($49.99)

    2. Best Shirt ($69.99)

    3. Cool Socks ($9.99)

How it works:
This example displays two variants of product pages to the users. Both pages use different sorting orders to display the list of products. It uses Optimizely feature flag in the Vercel Middleware to determine the sort order and to redirect users to correct pages. A unique visitor id is being generated, stored in the cookie and reused so that the decisions stick for the same browser session.

This example uses Optimizely Javascript SDK inside Vercel Middleware to provide a starting point for you to implement experimentation and feature flagging for your experiences at the edge. For a guide to getting started with our platform more generally, this can be combined with the steps outlined in our Javascript Quickstart here.

Identity Management
Out of the box, Optimizely's Full Stack SDKs require a user-provided identifier to be passed in at runtime to drive experiment and feature flag decisions. This example generates a unique id, stores it in a cookie and reuses it to make the decisions sticky. Another common approach would be to use an existing unique identifier available within your application.

For more information on how Optimizely Full Stack SDKs bucket visitors, see here.