I'm trying to make a connection to Dialogflow API. I downloaded the JSON file with all the credentials and placed the file in my project src folder.
Here is my code:
import React from 'react';
import './App.css';
import jsonInfo from './google.json';
const dialogflow = require('dialogflow');
function App() {
const sessionClient = new dialogflow.SessionsClient({
keyFilename: jsonInfo
});
return (
<div className="App">
<h1>Hello World!</h1>
</div>
);
}
export default App;
The error it gives:
You need to pass auth instance to use gRPC-fallback client in browser. Use OAuth2Client from google-auth-library.
Can someone help me with this. Thank you.