0.0.10 • Published 9 years ago

wavy-sdk v0.0.10

Weekly downloads
2
License
MIT
Repository
github
Last release
9 years ago

wavy-nodejs-sdk

Description

Wavy official SDK, use it to log-in, and perform action on your account

Description

It's a simple wrapper around PouchDB that handle authentification to our api

Get Started

Login

import WavySDK from 'wavy-sdk';

const wavySDK = new WavySDK('john.doe@gmail.com', 'sταяωαяs');

More login...

//simple auth
const wavySDK = new WavySDK('john.doe@gmail.com', 'sταяωαяs');

//callback when login and initialization finished
const wavySDK = new WavySDK('john.doe@gmail.com', 'sταяωαяs', (err, resp) => console.log(err, sdk));

//custom options
const wavySDK = new WavySDK('john.doe@gmail.com', 'sταяωαяs', {logs:true});

//custom options + callback
const wavySDK = new WavySDK('john.doe@gmail.com', 'sταяωαяs', {logs:true}, (err, sdk) => console.log(err, sdk));

save document in the DB

  let discount = {
    _id:'_discount_09088947162307803',
    doctype:'discount',
    type:'relative',
    value:20,
    name:'Student\'s Discount'
  }

  wavySDK.upsert(goodDiscount, (err, resp) => {
    console.log(err, resp)
    
  })

get document

  wavySDK.get(goodDiscount._id, (err, resp) => {
    console.log(err, resp)
  })

get list of documents of a certain types

learn more about pouchDB queries here

  wavySDK.query('salons/documentByType', {key:'discount'}, (err, resp) => {
        console.log({err, resp})
        done()
  })
0.0.10

9 years ago

0.0.8

10 years ago

0.0.7

10 years ago

0.0.6

10 years ago

0.0.5

10 years ago

0.0.4

10 years ago

0.0.3

10 years ago

0.0.2

10 years ago

0.0.1

10 years ago