Learn about our RFC process, Open RFC meetings & more.Join in the discussion! »

feather-server-node

0.1.21 • Public • Published

Feather Node.js Library

npm

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

Installation

$ npm install feather-server-node --save
# or 
$ yarn add feather-server-node

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-server-node")("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

Install

npm i feather-server-node

DownloadsWeekly Downloads

24

Version

0.1.21

License

MIT

Unpacked Size

70 kB

Total Files

21

Last publish

Collaborators

  • avatar