Does exist an easy way to connect Dialogflow agent to node.js code? When I use this code with the correct projectID taken from the Dialogflow agent\'s settings
It is not very well documented, but the easiest way to authenticate is using the JSON file provided on your google cloud platform console.
const sessionClient = new dialogflow.SessionsClient({
keyFilename: '/path/to/google.json'
});
const sessionPath = sessionClient.sessionPath(projectId, sessionId);
This also works for all the other clients. ContextsClients, EntityTypesClient and so on.