Flags SDK with OpenFeature adapter

Flags SDK with OpenFeature adapter

Use OpenFeature providers with the Flags SDK

0

boilerplate.detail.metadata.lastUpdated

il y a 4 mois

R

boilerplate.detail.metadata.author

Renaud

boilerplate.detail.metadata.price

boilerplate.detail.metadata.free

npx boilerapp flags-sdk-openfeature

Documentation

OpenFeature Flags SDK Example

This example uses OpenFeature for feature flags with the Flags SDK and the Flags SDK OpenFeature adapter along with the Flags Explorer.

Demo

https://flags-sdk-openfeature.vercel.app/

How it works

This demo uses two feature flags defined in code control the visibility of two banners on the page. Both flags are configured to show/hide each banner 50% of the time.

Once you visit the page, you can see a variation of both/one/none of the banners. Since this example is using a stable id to identify users, you will see the same variation until you reset your id.

To test different variations, you can use the Dev Tools at the bottom to reset the stable id and reload the page. This allows you to test different variations of the banners.

If you deployed your own instance of this example you can also use the Flags Explorer to test different variations by creating overrides.

Deploy this template

Deploy with Vercel

Step 1: Link the project

First, install the latest version of the Vercel CLI:

pnpm i -g vercel

or

npm i -g vercel

To use the Flags Explorer, you need to connect your local project to your Vercel project:

vercel link

Select the project from the list you just deployed.

Step 2: Pull all environment variables

This allows the Flags SDK and the Flags Explorer to work correctly, by getting additional metadata.

vercel env pull

Step 3: Install dependencies

pnpm install

or

npm install --legacy-peer-deps

Step 4: Run the project

pnpm run dev

or

npm run dev

boilerplate.detail.sections.discussion

Comments (0)

FAQ

Frequently Asked Questions

Have a question? We have the answers. If you can't find what you're looking for, feel free to contact us.

Boilerapp is a community platform dedicated to sharing boilerplates, starter kits, and project templates for developers. Our goal is simple: save you time on initial setup so you can code what really matters. Whether you are looking for a simple code base or a complete SaaS project, you will find it here.

Have more questions?

Our team is here to help. Contact us and we will get back to you as soon as possible.

Flags SDK with OpenFeature adapter | BoilerApp