The Dialogflow Node.js Client Library is a client for the Dialogflow V2 API which you can install on a Node server — as of the time of writing this piece, that’s your option. You’d need to install that on a server and then create your own front-end commands to communicate with your own Node server — there is no Dialogflow service running like with Dialogflow V1’s SDK which you can just connect to.
The reason for this? It seems to be due to the new way they do authentication.
In order to connect to Dialogflow’s new V2 API, you’ve got to authenticate with Google’s Cloud service and to do so, you’ll need a private JSON file with a private key that authenticates your app. You can’t have that on the front-end… if anyone could read that in their browser, they could do anything they wanted with your app. That would be bad.
For those who don’t want to put together a whole Node server, you can still use the V1 API at the moment. However, it does seem to go down occasionally.
There is still a way to get Dialogflow hooked up to a front-end, but you’ll need to do a bunch of the work on your own for this to be possible. I’m hoping to find a way to make things easier!
Learn to build for the Amazon Echo, Google Home, Facebook Messenger, Slack & more!