Giter VIP home page Giter VIP logo

botkit-multi-fb-pages's Introduction

botkit-multi-fb-pages

This is a little project, meant to be a proof of concept, on how to deal with multiple Facebook pages using Botkit.

The idea

The idea behind is to use a common webhook for the Facebook payloads and a pool of Botkit instances to do the rest. The common webhook will receive messages and then route them to the proper controller identified by its own url (containing the page-id). Every controller listens on localhost with a url like this:

http://localhost:<PORT>/facebook/<PAGE-ID>/receive

When the bot receives a message it just let it flow down the pipeline and do the usual processing. It will answer to the right page using the token it was instantiated with.

The following env variables are used:

DEBUG= <true|false>
FB_VERIFY_TOKEN= ....
FB_WEBHOOK_PORT= ....
POOL_PORT= ....

To give it a try use nginx (or equivalent) as a reverse proxy to expose the webhook endpoint and add a couple of pages in the bots-pool.js. Then run everything with:

nodejs start.js

Cheers!

botkit-multi-fb-pages's People

Contributors

danieledp avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

botkit-multi-fb-pages's Issues

How to validade the webhook on facebook?

Hi, need some help. The server is on, I am using ngrok, got the ID and token from my pages, however cannot validate on Facebook.

I tried this 2 ways:

First try: https://.ngrok.io
Second try: https://.ngrok.io/facebook//receive

How was supposed to be?

Thanks a lot.

print 1

print 2

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.