Coder Social home page Coder Social logo

node-account-kit's Introduction

node-account-kit

Account Kit helps you quickly register for apps using just your phone number or email address โ€” no password needed. It's reliable, easy to use and gives you a choice about how you sign up for apps.

node-account-kit is a nodeJS module to handle account-kit server side implementation.

Full documentation for account kit can be found here http://l.sgoyal.net/2ct7zQh

Version

1.0.0

DEMO

Click http://l.sgoyal.net/accountkit to see running demo.

Demo Code available here https://github.com/sgoyalnet/account-kit-app

Features

  • Generate randon non gussable string which can be passed to front end javascript file to be used for csrf.
  • One shot function to authenticate and generate access token and return user information.
  • support require app secret option.
  • User data removal support.

Installation

npm install node-account-kit

Usages

Step 1 Include module to your server.js

var accountkit = require ('node-account-kit');

Step 2 Configure account kit.

accountkit.set ("API_VERSION", "APP_ID", "ACCOUNT_KIT_APP_SECRET");
// all info can be found on developer site at facebook 
accountkit.requireAppSecret (true);// if you have enabled this option

https://developers.facebook.com/apps/

Step 4 Use it. user data can be fetched inside the post request which client have submitted after account kit login. AngularJs helper library can be seen here https://github.com/sgoyalnet/ng-account-kit

//accountKitState and accountKitCode are the response thet we get from account kit login operation. look for sample app for more usage information.
accountkit.getUserData (res, req.body.accountKitState, req.body.accountKitCode, function(resp) {
  res.send (resp);
    /**
    {
        "email": {
            "address": "[email protected]"
        },
        "id": "941488975973375"
    }
    */
});
// deleting user data
//id is account-kit user id
accountkit.deleteUser(req.query.id, function(resp){
	res.send (resp);
});

Methods

  • accountkit.getUserData (response, accountKitState, accountKitCode, callback);
  • deleteUser (id, callback);

Contribute

Do you want to improve it? Sounds cool. Please drop me a line at [email protected]

node-account-kit's People

Contributors

goyalshubham13 avatar

Stargazers

Nasreddine avatar Ali Abbas avatar Alvin Milton avatar Signo avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.