2.1.1 • Published 7 years ago

suddenly-api v2.1.1

Weekly downloads
10
License
ISC
Repository
github
Last release
7 years ago

Suddenly API Client

CircleCI

A simple API consumer that supports JSON Web Token auth.

Usage

The HTTP methods get, post, put, and delete are supported.

const API = require('suddenly-api');
const api = new API('https://example.com');


api.get('/things').then((things) => {
    console.log(things);
}).catch((err) => {
    console.log(err);
});


// Post and Put use a payload
api.post('/things', { name: 'New Thing' }).then((thing) => {
    console.log(thing);
}).catch((err) => {
    console.log(err);
});

Session objects can be set (token is expected if using JSON Web Tokens):

api.setSession({ token: 'encodedtokenstring' });
2.1.1

7 years ago

2.1.0

7 years ago

2.0.0

7 years ago

1.3.0

7 years ago

1.2.0

7 years ago

1.1.1

7 years ago

1.1.0

7 years ago

1.0.0

8 years ago