node package manager
Share your code. npm Orgs help your team discover, share, and reuse code. Create a free org ยป



Facebook authentication.

var idpFacebook = require('idp-facebook')({ clientID: '1234', clientSecret: 'secret', 'redirectUri': '' });

// Get the auth URL to redirect the user for OAuth2 login
idpFacebook.authUrl({ state: 'session_id' });

// Using the code provided in the query string upon return to your web app, get the identity:
idpFacebook(code, function (err, identity) {
  if (err) {
  else {
    do_amazing_things_with(,, identity.url, identity.accessToken);