@configu/browser
TypeScript icon, indicating that this package has built-in type declarations

0.24.0 • Public • Published

@configu/browser

Configu SDK for the Browser published to npm.

Install

npm install @configu/browser
yarn add @configu/browser
pnpm add @configu/browser
<script src="https://unpkg.com/@configu/browser/dist/configu.min.js" charset="utf-8"></script>

Usage

import {
  LocalForageConfigStore,
  ConfigSet,
  ConfigSchema,
  UpsertCommand,
  EvalCommand,
  ExportCommand,
} from '@configu/browser';
import schemaContents from './get-started.cfgu.json';

(async () => {
  try {
    const store = new LocalForageConfigStore({ name: 'config-db' });
    const set = new ConfigSet('test');
    const schema = new ConfigSchema('get-started', schemaContents);

    await new UpsertCommand({
      store,
      set,
      schema,
      configs: {
        'GREETING': 'hey',
        'SUBJECT': 'configu browser sdk'
      },
    }).run();

    const data = await new EvalCommand({
      store,
      set,
      schema,
    }).run();

    const configurationData = await new ExportCommand({
      pipe: data,
    }).run();
  } catch (error) {
    console.error(error);
  }
})();

Reference

oss.configu.com/browser

Contributing

Requirements

Follow the Development section from the CONTRIBUTING.md.

Setup

Run these commands in order:

cd ts
npm install

Contribute

Follow the Sending a Pull Request section from the CONTRIBUTING.md.

Package Sidebar

Install

npm i @configu/browser

Homepage

configu.com

Weekly Downloads

12

Version

0.24.0

License

Apache-2.0

Unpacked Size

4.43 MB

Total Files

14

Last publish

Collaborators

  • rootconfigu