# facebook-node-sdk

> Node.js SDK for the Facebook API

Latest version **0.2.0** (published 2012-02-04) · MIT license · 0 weekly downloads

## Install

```sh
npm install facebook-node-sdk
pnpm add facebook-node-sdk
yarn add facebook-node-sdk
bun add facebook-node-sdk
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.2.0 |
| Published | 2012-02-04 |
| First published | 2011-12-07 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | * |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 232 |
| Author | Hitoshi Amano |
| Maintainers | amachang |

## Links

- npm: https://www.npmjs.com/package/facebook-node-sdk
- Repository: https://github.com/amachang/facebook-node-sdk
- Issues: https://github.com/amachang/facebook-node-sdk/issues
- npm.io page: https://npm.io/package/facebook-node-sdk

## Recent versions

- 0.2.0 (latest) — 2012-02-04
- 0.1.14 — 2012-02-03
- 0.1.13 — 2012-02-03
- 0.1.12 — 2012-02-01
- 0.1.11 — 2012-01-12
- 0.1.10 — 2012-01-05
- 0.1.9 — 2012-01-04
- 0.1.7 — 2011-12-30
- 0.1.6 — 2011-12-21
- 0.1.5 — 2011-12-17
- 0.1.4 — 2011-12-16
- 0.1.3 — 2011-12-13
- 0.1.2 — 2011-12-13
- 0.1.1 — 2011-12-13
- 0.1.0 — 2011-12-13
- … 1 more at https://npm.io/package/facebook-node-sdk/versions

## README

# Facebook Node SDK

Facebook API Implementation in Node.

[![Build Status](https://secure.travis-ci.org/amachang/facebook-node-sdk.png)](http://travis-ci.org/amachang/facebook-node-sdk)

## Features

* Supports all Facebook Graph API, FQL, and REST API.
* Compatible with the official Facebook PHP SDK.

## Install

To install the most recent release from npm, run:

    npm install facebook-node-sdk

## Synopsis

    var Facebook = require('facebook-node-sdk');
    
    var facebook = new Facebook({ appID: 'YOUR_APP_ID', secret: 'YOUR_APP_SECRET' });
    
    facebook.api('/amachang', function(err, data) {
      console.log(data); // => { id: ... }
    });

### With express framework (as connect middleware)

    var express = require('express');
    var Facebook = require('facebook-node-sdk');
    
    var app = express.createServer();
    
    app.configure(function () {
      app.use(express.bodyParser());
      app.use(express.cookieParser());
      app.use(express.session({ secret: 'foo bar' }));
      app.use(Facebook.middleware({ appId: 'YOUR_APP_ID', secret: 'YOUR_APP_SECRET' }));
    });
    
    app.get('/', Facebook.loginRequired(), function (req, res) {
      req.facebook.api('/me', function(err, user) {
        res.writeHead(200, {'Content-Type': 'text/plain'});
        res.end('Hello, ' + user.name + '!');
      });
    });

---
_Source: https://npm.io/package/facebook-node-sdk · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
