unleash-appconfig-repository
v1.0.1
Published
Use AWS AppConfig as a backend for Unleash feature flags
Downloads
2
Readme
Use AWS AppConfig as a backend for Unleash feature flags
Install
yarn install unleash-appconfig-repository
Usage
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.
Create an AppConfig
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": [],
},
]
Use the Repository
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,
});
Author
👤 Ben Force
- Website: https://thebenforce.com/
- Twitter: @theBenForce
- Github: @theBenForce
- LinkedIn: @theBenForce
🤝 Contributing
Contributions, issues and feature requests are welcome!Feel free to check issues page.
Show your support
Give a ⭐️ if this project helped you!
This README was generated with ❤️ by readme-md-generator