Use AWS AppConfig as a backend for Unleash feature flags
yarn install unleash-appconfig-repository
There are two steps to using this plugin. First, you have to setup an AppConfig configuration. Next you need to
instantiate this plugin and pass it to unleash's initialize
function.
The content of the configuration will be an Array of the type FeatureInterface
. More details can
be found in the unleash-client-node repository.
Here's an example config with one flag called "Test":
[
{
"name": "Test",
"enabled": true,
"type": 'release',
"impressionData": false,
"stale": false,
"variants": [],
"strategies": [],
},
]
To use this repository, you need to create an instance and pass it to Unleash as a custom repository during initialization. The parameters for the repository come from the AppConfig Configuration that you created in the previous step.
Note: this plugin will always pull the latest version of the configuration
import { AppConfigRepository } from 'unleash-appconfig-repository';
import { initialize } from 'unleash-client';
const repo = new AppConfigRepository({
// These values are used to request the configuration from AWS AppConfig
applicaion: 'abc',
environment: 'production',
configuration: 'featureFlags',
clientId: '123',
});
const client = initialize({
appName: 'abc',
url: 'not-required',
repository: repo,
});
👤 Ben Force
- Website: https://thebenforce.com/
- Twitter: @theBenForce
- Github: @theBenForce
- LinkedIn: @theBenForce
Contributions, issues and feature requests are welcome!
Feel free to check issues page.
Give a ⭐️ if this project helped you!
This README was generated with ❤️ by readme-md-generator