Openwhyd API Client
A simple Node.js API client for Openwhyd.org.
Your can use it to:
- initiate a cookie-based Openwhyd user session, given their email address and password;
- make authenticated calls to Openwhyd's API endpoints;
- end the user session.
Usage
- Install the npm dependency to your Node.js project:
$ npm install openwhyd-api-client
- Use it to make API calls:
const OpenwhydAPI = ; const creds = email: "me@email.com" // email address or user handle of your openwhyd account md5: "6af652b33ce6a86ecf025b0da8ca8d24" // md5 hash of your openwhyd password; const openwhydAPI = ; openwhydAPI;
Methods
The class exported from the package provides the following methods:
login (email, md5, callback)
get (path, params, callback)
logout (callback)
All callback
functions are called with (err, res)
as parameters.
Each instance of the class holds the cookie that identifies the user session initiated with that instance.