Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

facebook-sdk

Package Overview
Dependencies
Maintainers
0
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

facebook-sdk

A full port of Facebook's PHP SDK library

  • 0.2.1
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
235
increased by7.31%
Maintainers
0
Weekly downloads
 
Created
Source

node.js Facebook SDK

This is a 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.

I retain the open source apache license of the original SDK. The node.js Facebook SDK is licensed under the Apache License, Version 2.0 (http://www.apache.org/licenses/LICENSE-2.0.html).

Usage

First, create a Facebook SDK object. The http request and response objects are not required for application graph requests or when setting the session manually. Otherwise they are recommended, for reading and verification of of the session from the request or cookie data, and for writing verified session data to the browser's cookie.

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

var facebook = new fbsdk.Facebook({
	appId  : 'YOUR APP ID',
	secret : 'YOUR API SECRET',
	request  : request (http.ServerRequest),
	response : response (http.ServerResponse)
});

To make API calls:

facebook.api('/me', function(me) {
	if (me.error) {
		console.log(me);
		return;
	}
	
	// do something interesting
});

Logged in vs Logged out:

if (facebook.getSession()) {
	print('<a href="' + facebook.getLogoutUrl() + '">Logout</a>');
} else {
	print('<a href="' + facebook.getLoginUrl() + '">Login</a>');
}

Tests

The tests have been ported as well. It was the easiest way to confirm the new node.js library works as expected. New tests are to be added as needed for reported bugs or new features.

Keywords

FAQs

Package last updated on 28 Feb 2011

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

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc