bdo-js

0.0.6 • Public • Published

BDO

This is the JavaScript client SDK for the BDO miniservice.

Usage

import bdo from 'bdo-js';

const saveKeys = (keys) => { /* handle persisting keys here */ };
const getKeys = () => { /* return keys here. Can be async */ };

const hash = 'this hash describes the context for this bdo';

const newBDO = {
  youc: 'an',
  put: 'whatever',
  you: {
    want: 'here',
    so: 'long',
    as: 'it\'s,
  },
  an: 'object'
};

const uuid = await bdo.createUser(hash, newBDO, saveKeys, getKeys);

newBDO.put = 'something else';

const user = await bdo.updateBDO(uuid, hash, newBDO); 

const userAgain = await bdo.getBDO(uuid, hash); 

const deleted = await bdo.deleteUser(uuid, hash); // returns true on success

Readme

Keywords

none

Package Sidebar

Install

npm i bdo-js

Weekly Downloads

20

Version

0.0.6

License

MIT

Unpacked Size

9.87 kB

Total Files

4

Last publish

Collaborators

  • zachbabb