unleash-appconfig-repository
TypeScript icon, indicating that this package has built-in type declarations

1.0.1 • Public • Published

Welcome to unleash-appconfig-repository 👋

Version License: MIT Release Status Twitter: theBenForce

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!

Buy Me A Coffee


This README was generated with ❤️ by readme-md-generator

Readme

Keywords

none

Package Sidebar

Install

npm i unleash-appconfig-repository

Weekly Downloads

0

Version

1.0.1

License

MIT

Unpacked Size

11.1 kB

Total Files

8

Last publish

Collaborators

  • benforce