0.2.0 • Published 1 year ago

cloud-configuration v0.2.0

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

Cloud Config

Manage your cloud configuration with ease.

Installation

npm install cloud-configuration

or

yarn add cloud-configuration

Basic Usage

import cloudConfig from 'cloud-configuration';

const configs = await cloudConfig.fetchAll();

const auFlagUrl = cloudConfig.get({ configs, featureKey: 'au_flag_url' }); // return value or null

const usFlagUrl = cloudConfig.getWithDefault({
  configs,
  featureKey: 'us_flag_url',
  defaultValue: 'https://example.com/us.png',
}); // return typed value or default value, good for typescript

Local .env examples

CLOUD_CONFIG_SERVER_ENCRYPT_SECRET=S_+2/QGV3Xz
CLOUD_CONFIG_SERVER_ACCESS_TOKEN=PRIVATE_U2FsdGVkX1/V6tnPtjtXIy9pX9oVKt1M73fasTvAsFpaQtvZg==
NEXT_PUBLIC_CLOUD_CONFIG_CLIENT_ENCRYPT_SECRET=C_/uTPZ+2Qrr
NEXT_PUBLIC_CLOUD_CONFIG_ORG_ID=U2FsdGVkX1/1dETBp2nedJo/uDqXrpc=

Whole package size

  • package size: < 10 kB

License

MIT

0.2.0

1 year ago

0.1.9

2 years ago

0.1.8

2 years ago

0.1.7

2 years ago

0.1.6

2 years ago

0.1.5

2 years ago

0.1.4

2 years ago

0.1.3

2 years ago

0.1.2

2 years ago

0.1.1

2 years ago

0.1.0

2 years ago