bottender-handovers
An experimental package for Messenger Handover Protocol with Bottender.
Installation
npm install bottender-handovers
Usage
const middleware = ;const handovers = ; const handleHandovers = ; // This bot should be assigned as primary receiver appbot;
Using Request Thread Control
bottender-handovers
provide two built-in functions to utilize Messenger Platform's Request Thread Control events. Simply pass them to shouldControlPass
option.
const middleware = ;const handovers = ;const isRequestThreadControlFrom = handovers; // request from and pass to 3rd party CRM serviceconst myCRMAppId = 123456;const handleHandovers = ; // request from and pass to Facebook Page Inboxconst handleHandovers = ;
Options
shouldControlPass(context): boolean
Default: () => false
.
shouldControlTake(context): boolean
Default: () => false
.
willControlPass(context)
Default: () => {}
.
willControlTake(context)
Default: () => {}
.
didControlPass(context)
Default: () => {}
.
didControlTake(context)
Default: () => {}
.
targetAppId
Default: 263902037430900
(Page Inbox).
License
MIT © Yoctol