feather-id

0.1.16 • Public • Published

Feather Node.js Library

npm Build Status Coverage Status

This library provides a convenient interface to the Feather API for applications running in a Node.js server environment.

Installation

$ npm install feather-id --save
# or 
$ yarn add feather-id

Usage

The Feather package must be initialized with your project's API key, available on the Feather Dashboard. Include the API key when you require the package:

const feather = require("feather-id")("live_...");

Using Promises

Every method returns a promise:

feather.credentials
  .create({
    type: "username|password",
    username: "jdoe",
    password: "pa$$w0rd"
  })
  .then(credential => {
    return feather.sessions.create({
      credential_token: credential.token
    });
  })
  .then(session => {
    return feather.users.retrieve(session.user_id);
  })
  .then(user => {
    // User of the newly created session
  })
  .catch(error => {
    // Handle errors
  });

Development

If you do not have yarn installed, you can install it with npm install --global yarn.

Run the tests:

$ yarn install
$ yarn test

More Information

Package Sidebar

Install

npm i feather-id

Weekly Downloads

0

Version

0.1.16

License

MIT

Unpacked Size

79.7 kB

Total Files

19

Last publish

Collaborators

  • feather-id