I am trying to leverage AWS Lambda as the webhook for dialogflow call. I want to use all the agent/google actions libraries.
So I copied the sample code and pasted it to Lambda what we get in Dialogflow console. I installed all the npm libraries. But when testing I am getting this issue:
TypeError: Cannot read property 'result' of undefined
at new WebhookClient (/var/task/node_modules/dialogflow-fulfillment/src/dialogflow-fulfillment.js:84:27)
at exports.dialogflowFirebaseFulfillment.functions.https.onRequest (/var/task/index.js:13:17)
at cloudFunction (/var/task/node_modules/firebase-functions/lib/providers/https.js:57:9)
I have exposed Lambda earlier but as the requirement is for the Dialogflow, I am not able to do so.
Note: I am passing the same request payload in Google Cloud and AWS Lambda, Google Cloud is returning correct but Lambda is returning error as mentioned above.
Not sure if I am missing any step or my understanding is wrong here.
Please help.