Dialogflow CX Webhook Integration with Express and ngrok This repository contains a Dialogflow CX agent integrated with a webhook built using Node.js and Express. The webhook processes user requests, handles fulfillment, and delivers dynamic responses from the server. ngrok is used to expose your local server to the internet for testing purposes with Dialogflow.
Features Webhook Fulfillment: Processes requests from Dialogflow CX and sends real-time, dynamic responses. Express Framework: Lightweight server setup using Express for handling HTTP requests. ngrok Integration: Exposes your local server for webhook testing in a Dialogflow CX agent. Easy Deployment: Ready to deploy on platforms like Heroku, AWS, or other Node.js hosting services. Installation and Setup Follow these steps to install and run the project:
- Clone the Repository bash Copy code git clone https://github.com/your-username/dialogflow-webhook-handler.git cd dialogflow-webhook-handler
- Install Dependencies bash Copy code npm install
- Set Up Environment Variables Create a .env file in the root directory to configure environment settings:
makefile Copy code PORT=3000 4. Run the Express Server Start your Express server by running:
bash Copy code npm start 5. Use ngrok to Expose Local Server To make your local webhook accessible to Dialogflow, run ngrok to tunnel the Express server:
bash Copy code ngrok http 3000 Copy the generated ngrok URL (e.g., https://abc123.ngrok.io) and use it in Dialogflow CX.
- Webhook Configuration in Dialogflow CX Go to your Dialogflow CX agent. Navigate to Fulfillment and add the ngrok URL followed by /webhook (e.g., https://abc123.ngrok.io/webhook) as your webhook endpoint. Project