The ConfigBee OpenFeature Provider (Web) enables you to use ConfigBee as the backend for managing feature flags in a web environment, utilizing the OpenFeature specification. This provider integrates seamlessly with your application, offering dynamic configuration and feature flagging capabilities with the flexibility of ConfigBee.
Website | Documentation | ConfigBee Openfeature Web Provider Docs
- Real-time feature flagging using ConfigBee's backend.
- Dynamic configuration capabilities for contextual and targeted feature delivery.
- Contextual targeting support using OpenFeature’s context API.
- Seamless integration with OpenFeature-compliant systems.
- Supports web applications built with JavaScript/TypeScript.
You can install the configbee-openfeature-provider-web via npm or yarn:
npm install configbee-openfeature-provider-webyarn add configbee-openfeature-provider-web💡 For the most up-to-date documentation, visit docs.configbee.com/openfeature-providers/web/
- You need a ConfigBee account. Sign up here.
- You need OpenFeature Web SDK installed in your project. If you haven't already set it up, follow the offical documention here
Here’s a simple example of how to use the ConfigBee provider with OpenFeature in a web application:
import { OpenFeature } from '@openfeature/js-sdk';
import { ConfigbeeWebProvider } from 'configbee-openfeature-provider-web';
// Initialize the provider with your ConfigBee account, project, and environment information
const configBeeProvider = new ConfigbeeWebProvider({
accountId: 'your-account-id',
projectId: 'your-project-id',
environmentId: 'your-environment-id',
});
// Set the ConfigBee provider for OpenFeature
OpenFeature.setProvider(configBeeProvider);
// Optionally set context for contextual targeting
await OpenFeature.setContext({ key: 'my-key' });
// Example: Fetching a feature flag based on the context
(async () => {
const flagValue = await OpenFeature.getClient().getBooleanValue('new_feature', false);
console.log(`New Feature Flag: ${flagValue}`);
})();ConfigBee supports contextual targeting, which allows you to deliver personalized feature configurations based on custom context data. You can use OpenFeature's context API to provide this data:
await OpenFeature.setContext({ userId: 'your-user-id' });The context can include various properties (e.g., user identifiers) to ensure targeted delivery of features and configurations based on the current application state.
The ConfigBee OpenFeature Provider (Web) is compatible with any framework based on the OpenFeature Web SDK, including React and Angular. As OpenFeature continues to expand, additional frameworks will be supported in the future.
For more information:
- React SDK: OpenFeature React SDK Documentation
- Angular SDK: OpenFeature Angular SDK Documentation
- All Available SDKs in Ecosystem: OpenFeature Ecosystem - JS Client SDKs
We welcome contributions to the ConfigBee OpenFeature Provider (Web)! Whether you're fixing bugs, adding new features, improving documentation, or enhancing test coverage, your input is valuable.
- Fork the repository: Start by forking the ConfigBee OpenFeature Provider (Web) repository to your GitHub account.
- (Optional) Create a branch: You can create a new branch for your feature or bug fix, though it's not mandatory.
- Make your changes: Develop and test your changes locally.
- Run tests: Ensure that all existing and new tests pass before submitting.
- Submit a pull request: Once your changes are ready and tested, submit a pull request to the main repository.
To build the project locally, run:
nx packageThis will generate the distributable package for the library.
Unit tests ensure that your changes don't break existing functionality. To execute the tests, run:
nx testWe use Jest for testing. Make sure your new code is covered by unit tests and that all tests pass before submitting your pull request.
- Ensure that your code adheres to the repository's coding style and guidelines.
- Write clear and concise commit messages.
- Provide detailed information in your pull request description, including what changes were made and why.