Use AWS AppConfig as a backend for Unleash feature flags
npm install unleash-appconfig-repositorysh
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.
$3
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":
`json
[
{
"name": "Test",
"enabled": true,
"type": 'release',
"impressionData": false,
"stale": false,
"variants": [],
"strategies": [],
},
]
`
$3
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
`typescript
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,
});
``