0.4.3 • Published 5 years ago

confit-client v0.4.3

Weekly downloads
2
License
ISC
Repository
github
Last release
5 years ago

Confit client ##########

Info

This is the Javascript client for the CONFIT Skillbill service

Dev and deploy

  • make your changes
  • modify packge.json version
  • commit your changes
  • build and add dist folder

    npm run version
  • push

    npm run postversion
  • publish

npm publish

the package is available here

Install

Using npm:

npm install --save confit-client

Using cdn:

<script src="https://unpkg.com/confit-client/dist/confit-client.iife.min.js"></script>
<script>
  // now a Confit object is accessible:
  Confit.load({...}).then(...);
</script>

Usage

Node application

Confit = require('confit-client')

React application

import  Confit  from  'confit-client';

Load a public configuration from alias:

Confit.load({
  repoId: '178474a9-360e-4299-a2e1-e8ae284ce909',
  alias: 'test.site.com-fe'
}).then(configuration => {
  console.log(configuration);
});

Load a private configuration from path:

Confit.load({
  repoId: '178474a9-360e-4299-a2e1-e8ae284ce909',
  repoSecret : 'f18d2da0-5a38-4b2f-8a05-c021cfe48821',
  path: 'test/be.json'
}).then(configuration => {
  console.log(configuration);
});

Instance

It is also possible to create a reusable instance with your defaults to load multiple files:

const confit = Confit.create({
  repoId : '178474a9-360e-4299-a2e1-e8ae284ce909', 
  repoSecret : 'f18d2da0-5a38-4b2f-8a05-c021cfe48821'
});

confit.load({
  path: 'globals.json'
}).then(globals => {
  console.log(globals);
});

confit.load({
  alias: 'be-conf'
}).then(configuration => {
  console.log(configuration);
});
0.4.3

5 years ago

0.4.2

5 years ago

0.4.1

5 years ago

0.4.0

6 years ago

0.3.0

6 years ago

0.2.1

6 years ago

0.2.0

6 years ago

0.1.1

6 years ago

0.1.0

6 years ago