I\'m trying to use the Google Cloud Translation API in my application but whenever I try to translate something it comes up with this missing valid API error.
I\'ve
If you are using client library and you have already downloaded your service account json file try below
// Instantiates a client
const translate = new Translate(
{
projectId: 'your project id', //eg my-project-0o0o0o0o'
keyFilename: 'path of your service acount json file' //eg my-project-0fwewexyz.json
}
);
instead of
// Instantiates a client
const translate = new Translate({projectId});
this way you need only your the service acount json file and the specific API enabled