I have followed the instructions to install the google-cloud/language npm on wix, and set up all my requirements for Google Cloud. But the error is still there. " Unhandled rejection Error: Could not load the default credentials. Browse to Autenticar para usar bibliotecas de cliente | Autenticação | Google Cloud for more information ." How should I change my code at the bottom in the jsw in order to make it work? Thanks.
async function quickstart() {
// Imports the Google Cloud client library
const language = require(‘@google-cloud/language’);
// Instantiates a client
const client = new language.LanguageServiceClient(); //<---- Am I missing something here?
// The text to analyze
const text = ‘Hello, world!’;
So projectId is the project id you will get from your google cloud account and credentials is an object which contains client_email and private_key which is something you get from the json file you downloaded from Google.
var projectId = 'TYPE IN YOUR PROJECT ID HERE';
var credentials = { "private_key": "PASTE KEY VALUE HERE", "client_email": "PASTE EMAIL HERE" };
const client = new vision.ImageAnnotatorClient({ projectId, credentials });