Let's say you've heard about the benefits of using feature flags for is a specification that provides a unified API for using feature flags. Going back to our earlier scenario, this means you'd use the same code to evaluate (get the values of) feature flags when trying out feature flag platforms for your company.
How does this work?
OpenFeature provides to connect their SDKs to OpenFeature SDKs. In short, OpenFeature providers act as a bridge between OpenFeature SDKs and feature flag platforms.
(currently available for JavaScript), you can use more than one feature flag platform during migration. This advantage also applies to homegrown feature flagging tools since you can create providers to make them accessible to OpenFeature.
OpenFeature encourages community collaboration and tool-sharing: The open-source community can collaborate and build vendor-agnostic tools around feature flags that everyone can benefit from. A good example is , a feature management platform with first-class OpenFeature support.
Demo
For this demo, I built an
I want to test newer, more powerful AI models for employees at PD-EF Corp, a fictional SaaS company, so I'll use feature flags to enable the feature for users whose emails end with @pd-efcorp.com.
Creating the Feature Flag in ConfigCat
Let's get started.
1) if you don't have an account.
2) Create a feature flag with the following details.
- Name: Enable pro models
- Key:
enable_pro_models
- Hint: Enable pro AI models for PD-EF Corp employees
We'll add the targeting rule for PD-EF Corp employees next.
3) Click IF +, then click Add rule with user condition.
You'll see two sections: an IF section for configuring the condition and a THEN section for setting the feature flag's value based on the condition.
4) In the IF section, select Email as the comparison attribute, then select ENDS WITH ANY OF (hashed) as the comparator.
6) Click SAVE & PUBLISH CHANGES.
Now that we've configured the feature flag, let's move on to the code.
Installing ConfigCat and OpenFeature
Prerequisites
- Node.js v18+
- Basic understanding of Node.js and Express
To use ConfigCat and OpenFeature together, we'll need to install ConfigCat's , which ConfigCat will use to determine whether the user's email matches the condition I set in the targeting rule.
Finally, I added a condition to return the appropriate model based on the feature flag's value. That's all the code we'll need. Let's see how it looks.
Once I open the website and sign in with a PD-EF Corp email address, I'll see the pro AI models.
on GitHub.
Why use ConfigCat with OpenFeature?
First-class OpenFeature support: ConfigCat builds and maintains its own and contribute by building tools and sharing knowledge with the feature-flagging community.
Recap
Thanks for accompanying me on this short trip through OpenFeature and ConfigCat. We covered:
- What OpenFeature is.
- The benefits of OpenFeature.
- How to create a feature flag in ConfigCat.
- How to use OpenFeature with ConfigCat.
- The benefits of using OpenFeature with ConfigCat.
Next Steps
Check out to get the latest updates.
If you're not using feature flags yet, you can start with ConfigCat. ConfigCat has for many popular programming languages and a , , and LinkedIn.
SOCIAL SHARE CARD GENERATOR