# cloud-configuration

> This package allows you to use CloudConfig easily.

Latest version **0.2.0** (published 2024-05-27) · MIT license · 0 weekly downloads

## Install

```sh
npm install cloud-configuration
pnpm add cloud-configuration
yarn add cloud-configuration
bun add cloud-configuration
```

## Health

**Score 30/100 (F)** — status: abandoned.

Positive: has types; esm support; no vulnerabilities; high quality score.

Warnings: low downloads; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.2.0 |
| Published | 2024-05-27 |
| First published | 2023-10-03 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 1 |
| Unpacked size | 88.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Alex Zeng |
| Maintainers | alexstack |

## Links

- npm: https://www.npmjs.com/package/cloud-configuration
- Repository: https://github.com/AlexStack/cloud-configuration
- Homepage: https://github.com/AlexStack/cloud-configuration#readme
- Issues: https://github.com/AlexStack/cloud-configuration/issues
- npm.io page: https://npm.io/package/cloud-configuration

## Dependencies (1)

- [crypto-js](https://npm.io/package/crypto-js.md) ^4.1.1

## Recent versions

- 0.2.0 (latest) — 2024-05-27
- 0.1.9 — 2023-10-13
- 0.1.8 — 2023-10-12
- 0.1.7 — 2023-10-07
- 0.1.6 — 2023-10-05
- 0.1.5 — 2023-10-04
- 0.1.4 — 2023-10-04
- 0.1.3 — 2023-10-03
- 0.1.2 — 2023-10-03
- 0.1.1 — 2023-10-03
- 0.1.0 — 2023-10-03

## README

# Cloud Config

Manage your cloud configuration with ease.

## Installation

```bash
npm install cloud-configuration
```

or

```bash
yarn add cloud-configuration
```

## Basic Usage

```typescript
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

```bash
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

---
_Source: https://npm.io/package/cloud-configuration · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
