1.1.0 • Published 9 years ago

@palante/facebook-api-tools v1.1.0

Weekly downloads
2
License
ISC
Repository
-
Last release
9 years ago

Palante Facebook API Tools

Description

Palante Facebook API Tools is a suite of tools leveraging facebook API's for use in node.js services. Leverages the fb facebook libarary found here to communicate with Facebook APIs.

Installation

npm i @palante/facebook-api-tools

Modules

getProfileInfo

Get profile info from facebook based on access token and queries profile @ /me.

import {getProfileInfo} from '@palante/facebook-api-tools';

const accessToken = 'myAccessToken';

getProfileInfo(accessToken, (err, profile) => {
    // your profile logic here
});

Upsert

Updates profile records in your persistence layer. A Data Access Object (DAO) must be passed in.

Simple DAO Example

perform your upsert logic here:

const dao = {
    save(profile, callback) {
        const saveProfile = saveProfile(profile);
        console.log('saved profile: ', profile);
        callback(null, profile);
    }
};

Use in project

Import and use in project

import {fbUpsert} from 'facebook-api-tools';

const upsert = fbUpsert(dao); // pass in Data Access Object here.

upsert(accessToken, function (err, result) {
    // error/result handling here.
});
1.1.0

9 years ago

1.0.0

9 years ago