@xapp/stentor-dialogflow-facebook
v1.86.7
Published
Stentor Dialogflow Facebook channel for stentor
Downloads
4,885
Readme
@xapp/stentor-dialogflow-facebook
Stentor Channel implementation for Dialogflow webhook requests that originate from the Facebook Messenger integration. It detects Facebook-sourced Dialogflow requests (originalDetectIntentRequest.source === "facebook"), translates them into a stentor Request by extending @xapp/stentor-dialogflow's TranslateDialogflowV2Request, and translates stentor Response objects back into Dialogflow fulfillmentMessages (text, a button panel built from suggestions, cards, and lists rendered as carousels). It also has experimental support for Facebook's handover protocol, passing thread control to a secondary app (response.data.handoffTargetId) when a response has system === "HANDOFF".
Required Environment Variables
PAGE_ACCESS_TOKEN- Facebook Page access token used to call the Facebook Graph API's/pass_thread_controlendpoint (only needed if using the handoff feature).
Usage
import { DialogflowFacebook } from "@xapp/stentor-dialogflow-facebook";
const channel = DialogflowFacebook();
// channel.test(body), channel.request.translate(body), channel.response.translate(requestResponse)