Skip to content
Facebook API module for nodejs
JavaScript
Find file
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
.gitignore
fb.js
package.json
readme.md

readme.md

Facebook-API

A Nodejs module for interpreting requests via a signed request.

install

npm install fb-api

Usage

var FB = require("fb-api");

Global

FB.set({
  appID: [appId],
  appSecret:[appSecret] 
});

Instance

FB invocation takes an object and returns a new instance. You can pass configuration options to overide defaults: appID, appSecret, url, timeout, accessToken.

var instance = FB({
  signedRequest: [string]
});

methods

parseSignedRequest returns a value

.parseSignedRequest();

getAccessToken takes a callback

.getAccessToken([optional-signedRequest-string], [callback(err, resp)]);

api takes an api method string, requestjs object and callback.

.api([api-method], [object], [callback(err, resp)]);

The object in the second parameter allows valid options using the requestjs framework https://github.com/mikeal/request#requestoptions-callback (note: extra feature is https: true).

Something went wrong with that request. Please try again.