Giter Club home page Giter Club logo

ai4tree2's Introduction

Messenger Platform Sample -- node.js

This project is an example server for Messenger Platform built in Node.js. With this app, you can send it messages and it will echo them back to you. You can also see examples of the different types of Structured Messages.

It contains the following functionality:

  • Webhook (specifically for Messenger Platform events)
  • Send API
  • Web Plugins
  • Messenger Platform v1.1 features

Follow the walk-through to learn about this project in more detail.

Setup

Set the values in config/default.json before running the sample. Descriptions of each parameter can be found in app.js. Alternatively, you can set the corresponding environment variables as defined in app.js.

Replace values for APP_ID and PAGE_ID in public/index.html.

Run

You can start the server by running npm start. However, the webhook must be at a public URL that the Facebook servers can reach. Therefore, running the server locally on your machine will not work.

You can run this example on a cloud service provider like Heroku, Google Cloud Platform or AWS. Note that webhooks must have a valid SSL certificate, signed by a certificate authority. Read more about setting up SSL for a Webhook.

Webhook

All webhook code is in app.js. It is routed to /webhook. This project handles callbacks for authentication, messages, delivery confirmation and postbacks. More details are available at the reference docs.

"Send to Messenger" and "Message Us" Plugin

An example of the "Send to Messenger" plugin and "Message Us" plugin are located at index.html. The "Send to Messenger" plugin can be used to trigger an authentication event. More details are available at the reference docs.

License

See the LICENSE file in the root directory of this source tree. Feel free to useand modify the code.

ai4tree2's People

Contributors

ppsreejith avatar

Watchers

 avatar  avatar  avatar

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.