0.1.0 • Published 8 years ago

node-happn v0.1.0

Weekly downloads
3
License
MIT
Repository
github
Last release
8 years ago

node-happn


Node package providing programmatic access to the Happn API

This package is under develop. For now, only authenticate an user.

Getting Started


Install the package

npm install node-happn

Use it:

First you need a facebook token to create a Happn User-Object. You can get the one associated with your facebook account by clicking here and copying it from the address bar.

  var HappnAPI = require('node-happen');

  var happnInstance = new HappnAPI();

  var fb_access_token = 'YOUR-FB-ACCESS-TOKEN';
  var assertion_type = 'facebook'; // only allows facebook.

  happnInstance.connect(
    fb_access_token,
    assertion_type,
    // callback
    function(err, resp){
      if (err) {
        console.log(err)
        return;
      }
      // user_id of the authenticated user.
      console.log(resp.user_id);
    }
  );

TODO

  • Can you see the list of features here.