Skip to content

Latest commit

 

History

History
79 lines (60 loc) · 4.07 KB

deploy-instructions.md

File metadata and controls

79 lines (60 loc) · 4.07 KB

Coaching chatbot Installation

$ npm install -g serverless
$ git clone https://github.com/kehitysto/coaching-chatbot.git
$ npm install

Rename .env.example to .env and fill in FACEBOOK_BOT_VERIFY_TOKEN. The verify token can be anything you choose. You will need it later.

$ serverless deploy

Copy the GET endpoint url

Facebook App Configuration

  1. In Facebook Developer site create new Facebook application and page
  1. Go to the App Dashboard. Select under Products "+Add Product" and choose Messenger. Next setup webhook by clicking Setup Webhooks
  • Callback URL -> use endpoint url copied in Coaching chatbot Installation
  • Verify Token -> use FACEBOOK_BOT_VERIFY_TOKEN filled in Coaching chatbot Installation
  • Select Subscription field messages
  • At this stage, the application is available only for developers and testers. The application needs to be approved by Facebook for public access
  • Click Verify and Save
  1. In the Token Generation section, select the page created in step 1 and copy the generated token
  2. In Webhooks section, select page created in step 1(Facebook App Configuration) to be the one that subscribes the webhooks
  3. Paste token copied in step 4 to .env file as FACEBOOK_BOT_PAGE_ACCESS_TOKEN
$ serverless deploy

More detailed instructions for Facebook Messenger platform configuration can be found from https://developers.facebook.com/docs/messenger-platform/quickstart/

Getting Facebook approvals

To make your application acceptable to other user your app should be approved by facebook

  • Prerequisites:
    • Your app must have App Icon (1024 x 1024) set.
    • Your app must have Privacy Policy URL set.
  1. You can set them by going to the application in facebook developers, Setting -> Basic

Instructions of approvals:

  1. Go to the application in facebook developers

  2. Choose Messenger under Products

  3. Scroll down to App Review for Messenger

  4. For the app to work properly, you should have pages_messaging pages_messaging_subscription approved, to do so press Add to Submission

  5. Scroll to Current Submissions and press Edit Notes.

    • pages_messaging
      • Example:

    Pages messaging

    • pages_messaging_subscription

      Pages messaging

      * Add description: "Our application will use pages_messaging_subscriptions to notify the user that some other users want to became their pair. The user can quite pair searching at any point if he/she doesn't want to get notification anymore. Permission is needed because the pair could be found after 24 hours after subscribing and it's possible that during this time few users want to send a request to the user." Feel free to change the description

      * Upload a Screencast showing one path of the possible conversations with the bot. This example should show what kind of messages the bot sends to users without the user initiating the conversation.
  6. Press Submit for Review

Deploying multiple versions

To deploy multiple versions of the chatbot you have to define a name for serverless deploy:

$ serverless deploy <name here>

After this you can follow the instructions from the top of this page onwards. You can see the different versions you have deployed in your aws lambda dashboard and also delete/modify them there. One good use for this is for example having a staging environment and a production environment.