1.0.1 ā€¢ Published 2 years ago

unleash-appconfig-repository v1.0.1

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

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

šŸ¤ 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

1.0.1

2 years ago

1.0.0

2 years ago