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

fb-wrapper

Package Overview
Dependencies
Maintainers
1
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

fb-wrapper

Facebook API client for Node.js

  • 1.0.10
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

fb-wrapper

npm Travis (.org) npm bundle size

Highly opinionated Facebook API client for Node.js

This is a small heavily opinionated utility wrapper library around facebook-node-sdk.
It is implemented with facade pattern which translates facebook-node-sdk library's existing interface into simplified one.

Install

npm i fb-wrapper

Usage:

Only most commonly used function for interacting with Facebook API are implemented:

  • postOnWall(msg: string): Promise<string>
  • getFeed()
  • getInfo(fields: string[] = ['id', 'name'])
const FacebookClient = require('fb-wrapper');
const facebookClient = new FacebookClient(facebookToken, facebookAppID, facebookAppSecret);

// post on the wall
try {
  const msgToPost = 'Post a test message';
  const postId = await facebookClient.postOnWall(msgToPost);
  console.log(postId);
} catch (e) {
  console.error(e);
}

// get feed
try {
  const feed = await facebookClient.getFeed();
  console.log(feed);
} catch (e) {
  console.error(e);
}

// get info
try {
  const requestedInfo = await facebookClient.getInfo(['id', 'name']);
  console.log(requestedInfo);
} catch (e) {
  console.error(e);
}

Keywords

FAQs

Package last updated on 16 Jun 2019

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