New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

node-fb-login

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

node-fb-login

Facebook login for Node.js projects

latest
Source
npmnpm
Version
1.0.0
Version published
Weekly downloads
10
233.33%
Maintainers
1
Weekly downloads
 
Created
Source

Facebook Login

Author : Arju S Moon Build Status

Facebook login modules, which can be used in your Node, Express.js Applications

  • Get Auth URL
  • Get Facebook Access Token
  • Get long-lived Access Token (Valid for 60 days)
  • Get Facebook User Profile

Installation

Requires Node.js v12+ to run.

Install the dependencies and devDependencies and start the server.

$ npm install node-fb-login

Usage

const nodeFbLogin = require('node-fb-login');

// Generate authentication URL
nodeFbLogin.generateAuthURL({
  fbAppID: "API_ID",
  redirectURI: "REDIRECT_URI",
  scopes:["public_profile","email"]
}).then(URL=>{
  console.log(URL);
}).catch(error=>{
  console.log(error);
})

// Get the short-lived Access Token by passing the code recieved from the Auth URL
nodeFbLogin.getAccessToken({
  code: "AUTH_CODE",
  fbAppID: "APP_ID",
  fbAppSecret: "APP_SECRET",
  redirectURI: "REDIRECT_URI"
}).then(accessToken => {
  console.log(accessToken);
}).catch(error => {
  console.log(error);
})

// Get the User profile by passing the Access Token
nodeFbLogin.getUserProfile({
  accessToken:"ACCESS_TOKEN",
  fields: ["id","name","email"]
}).then(user => {
  console.log(user);
}).catch(error => {
  console.log(error);
})

// Get long-lived Access Token by passing the short-lived access token (Valid for 60 days)
nodeFbLogin.getLongLivedAccessToken({
  fbAppID: "APP_ID",
  fbAppSecret: "APP_SECRET",
  accessToken: "ACCESS_TOKEN"
}).then(accessToken => {
  console.log(accessToken);
}).catch(error => {
  console.log(error);
})

Keywords

facebook

FAQs

Package last updated on 12 Feb 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts