joan-js

0.0.2 • Public • Published

Joan

This is the JavaScript client SDK for the Joan miniservice.

Usage

import joan from 'joan-js';

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

const email = 'foo@bar.com';
const password = 'password';
const credentialsHash = yourHashingFunction(email + password);

const uuid = await joan.createUser(credentialsHash, saveKeys, getKeys);

const user = await joan.reenter(credentialsHash, saveKeys, getKeys); 

const newPassword = 'newPassword';
const newHash = yourHashingFunction(email + newPassword);

const userAgain = await joan.updateHash(uuid, credentialsHash, newHash); 

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

Dependents (1)

Package Sidebar

Install

npm i joan-js

Weekly Downloads

57

Version

0.0.2

License

MIT

Unpacked Size

3.71 kB

Total Files

3

Last publish

Collaborators

  • zachbabb