Socket
Book a DemoInstallSign in
Socket

facebook-nodejs-sdk

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

facebook-nodejs-sdk

A port of Facebook's PHP SDK library

0.1.0
latest
Source
npmnpm
Version published
Weekly downloads
12
20%
Maintainers
1
Weekly downloads
 
Created
Source

node.js Facebook SDK

This is a complete port of Facebook's PHP SDK library.

The Facebook Platform is a set of APIs that make your application more social. Read more about integrating Facebook with your web site on the Facebook developer site.

The node.js Facebook SDK is licensed under the Apache License, Version 2.0, as was the original library.

Install

npm install facebook-nodejs-sdk

Use as connect middleware

The following will attach a new Facebook object to each incoming http request. For more information on querying Facebook's graph api, see developers.facebook.com.

var connect = require('connect'),
  fbsdk = require('facebook-sdk');

connect()
  .use(connect.cookieParser())
  .use(connect.bodyParser())
  .use(fbsdk.facebook({
    appId  : 'YOUR APP ID',
    secret : 'YOUR API SECRET'
  }))
  .use(function(req, res, next) {

    if (req.facebook.getSession()) {
      res.end('<a href="' + req.facebook.getLogoutUrl() + '">Logout</a>');

      // get my graph api information
      req.facebook.api('/me', function(me) {
          console.log(me);
      });

    } else {
        res.end('<a href="' + req.facebook.getLoginUrl() + '">Login</a>');
    }

  })
  .listen(3000);

Keywords

facebook

FAQs

Package last updated on 05 Apr 2014

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

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.