Skip to main content

Feature Flags in a NextJS SSR application

How do you experiment in a server-side rendered app?

O
Written by Optimize Team
Updated over 2 months ago

Feature flags are a common approach to experimentation in a single page app such as those built with React/NextJS.

Server-side rendering (SSR) adds a layer of complexity to this, with an inability to access localstorage.

To help with this, we have created the above demo of feature flagging in a NextJS SSR.

This took about 10 minutes to build, and is an illustration of one approach to solving this problem. There are many when using technologies like React/Next, and more considering they come with different types of routers, rendering, etc.

This approach focuses on Server-side Rendered apps, solving specific problems they encounter.

How to get the demo working

Simply git clone the repo, and run npm install

Then run the app using npm run dev

Full details can be found in the repo.

Did this answer your question?