1.0.4 • Published 1 year ago

rubik-facebook v1.0.4

Weekly downloads
2
License
Apache-2.0
Repository
-
Last release
1 year ago

rubik-facebook

Facebook's Bot API kubik for the Rubik

Install

npm

npm i rubik-facebook

yarn

yarn add rubik-facebook

Use

const { App, Kubiks } = require('rubik-main');
const Facebook = require('rubik-facebook');
const path = require('path');

// create rubik app
const app = new App();
// config need for most modules
const config = new Kubiks.Config(path.join(__dirname, './config/'));

const facebook = new Facebook();

app.add([ config, facebook ]);

app.up().
then(() => console.info('App started')).
catch(err => console.error(err));

Config

facebook.js config in configs volume may contain the host and token.

If you do not specify a host, then https://graph.facebook.com/ will be used by default.

If you don't specify a token, you will need to pass it.

...
const response = await app.get('facebook').debugToken();
...
...
const response = await app.get('facebook').me.subscribedApps();
...

You may need the host option if for some reason Facebook host is not available from your server and you want to configure a proxy server.

For example: config/facebook.js

module.exports = {
  host: 'https://my.facebook.proxy.example.com/'
};

Extensions

Facebook kubik doesn't has any extension.

1.0.4

1 year ago

1.0.2

2 years ago

1.0.1

3 years ago

1.0.0

3 years ago