@xapp/stentor-dialogflow-facebook 1.86.5 → 1.86.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/README.md +21 -0
  2. package/package.json +10 -10
package/README.md ADDED
@@ -0,0 +1,21 @@
1
+ ## @xapp/stentor-dialogflow-facebook
2
+
3
+ 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"`.
4
+
5
+ ### Required Environment Variables
6
+
7
+ - `PAGE_ACCESS_TOKEN` - Facebook Page access token used to call the Facebook Graph API's `/pass_thread_control` endpoint (only needed if using the handoff feature).
8
+
9
+ ### Usage
10
+
11
+ ```ts
12
+ import { DialogflowFacebook } from "@xapp/stentor-dialogflow-facebook";
13
+
14
+ const channel = DialogflowFacebook();
15
+ // channel.test(body), channel.request.translate(body), channel.response.translate(requestResponse)
16
+ ```
17
+
18
+ ### Documentation
19
+
20
+ - [Dialogflow Fulfillment Webhook](https://cloud.google.com/dialogflow/es/docs/fulfillment-webhook)
21
+ - [Facebook Messenger Platform - Handover Protocol](https://developers.facebook.com/docs/messenger-platform/handover-protocol)
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
7
- "version": "1.86.5",
7
+ "version": "1.86.7",
8
8
  "description": "Stentor Dialogflow Facebook channel for stentor",
9
9
  "types": "lib/index",
10
10
  "main": "lib/index",
@@ -24,20 +24,20 @@
24
24
  "mocha": "11.8.0",
25
25
  "sinon": "21.0.0",
26
26
  "sinon-chai": "3.7.0",
27
- "stentor-constants": "1.74.5",
28
- "stentor-guards": "1.74.5",
29
- "stentor-interaction-model": "1.74.8",
30
- "stentor-media": "1.74.9",
31
- "stentor-models": "1.79.0",
32
- "stentor-request": "1.74.8",
33
- "stentor-response": "1.74.9",
34
- "stentor-utils": "1.75.4",
27
+ "stentor-constants": "1.74.7",
28
+ "stentor-guards": "1.74.7",
29
+ "stentor-interaction-model": "1.74.11",
30
+ "stentor-media": "1.74.14",
31
+ "stentor-models": "1.81.0",
32
+ "stentor-request": "1.74.11",
33
+ "stentor-response": "1.74.14",
34
+ "stentor-utils": "1.76.2",
35
35
  "ts-node": "10.9.2",
36
36
  "typescript": "5.9.3"
37
37
  },
38
38
  "dependencies": {
39
39
  "@xapp/patterns": "2.0.3",
40
- "@xapp/stentor-dialogflow": "1.86.5"
40
+ "@xapp/stentor-dialogflow": "1.86.7"
41
41
  },
42
42
  "peerDependencies": {
43
43
  "stentor-constants": "1.x",