Home / DialogFlow ES / Client side JavaScript apps (Angular, React, Ionic etc) and Dialogflow REST API v2
DialogFlow ES | REST API

Client side JavaScript apps (Angular, React, Ionic etc) and Dialogflow REST API v2

I got a question from a reader:

Can I use a client side JavaScript app built using Ionic with Dialogflow’s v2 REST API?

It could have also been Angular, or React, or one of the other bajillion other JavaScript frameworks. 🙂

The answer to all of you: No!

The workaround

You need to use the concept of Dialogflow REST API middleware

1 The middleware code runs on a server

2 You need to use a server side programming language such as NodeJS

3 You will save the service account JSON file to the server folder where your code is located (or some other folder you can access from the code)

4 You will set up a ‘relay’ between your JS app and your Dialogflow agent

5 You will communicate with your Dialogflow agent by using the REST API

This website contains affiliate links. See the disclosure page for more details. 
"The magic key I needed as a non-programmer"

The custom payload generator was the magic key I needed (as a non-programmer) to build a good demo with rich responses in DialogFlow Messenger. I've only used it for 30 minutes and am thrilled. I've spent hours trying to figure out some of the intricacies of DialogFlow on my own. Over and over, I kept coming back to Aravind's tutorials available on-line. I trust the other functionalities I learn to use in the app will save me additional time and heartburn.

- Kathleen R
Cofounder, gathrHealth
In this free course, I provide some tips for managing large Dialogflow ES bots without compromising on accuracy.

Similar Posts