Questions tagged [google-api-nodejs-client]
google-api-nodejs-client is Google's officially supported node.js client library for accessing Google APIs, it also supports authorization and authentication with OAuth 2.0.
713
questions
0
votes
2
answers
36
views
Use Google Cloud Secret Manager to fetch AUTH0_CLIENT_SECRET and use with nextjs-auth0
I have a Next.js application where authentication is set up with the Auth0 Next.js SDK.
Currently the AUTH0_CLIENT_SECRET is being set as an environment variable when deploying.
I would like to use ...
0
votes
2
answers
20
views
Correct way to write a params api in node js
app.post('/scripts/:freezeId', scriptsView.findAll);
app.post('/scripts/deleteScripts', scriptsView.deleteconfig);
Is the only way the second API needs to write on top of the params API or any other ...
0
votes
0
answers
20
views
node js application logs on cloud logging
My NodeJS application is deployed on cloud run and I want to write my NodeJS application log separately on cloud logging , so I created a log bucket called log-test-bucket and gave cloud run service ...
0
votes
0
answers
49
views
Sent html email using gmail API, it appears in "chinese" on apple mail client
I am sending emails using the Gmail NodeJS API using these code snippet (leaving auth out of it)
const headers: any = {
'To': event.to,
'Subject': event.subject,
...
1
vote
1
answer
45
views
Service account doesn't get the quota from Google one
One friend of mine subscribed to Google one and granted permission to me use the storage, the problem is when i'm using a service account to upload a file to google drive, the storage shows as 15GB ...
0
votes
0
answers
37
views
How to search for web and images results from Google Custom Search JSON API?
I'm implementing Google's Custom Search JSON API into my application which shall search for both web and images. I am able to query for web and images independently.
For web: https://www.googleapis....
2
votes
1
answer
53
views
What are REDIRECT_URI and REFRESH_TOKEN needed for in the Google Drive API?
I have doubts about how the Google Drive API works and how should I use it for my use cases. I have a REST API (based on NodeJS) which uploads documents in the drive. The only user that is actually ...
0
votes
0
answers
49
views
google-api-nodejs-client - Service Account credentials authentication issues
I am trying to use the google-api-nodejs library to manage some resources in the google Campaign Manager API.
I have confirmed that we currently have a project configured, and that this project has ...
0
votes
1
answer
42
views
google-api-nodejs-client API key - 401 Login required
I am trying to use the google-api-nodejs library to manage some resources in the google Campaign Manager API.
I have confirmed that we currently have a GCP project configured, and that this project ...
0
votes
1
answer
39
views
How to get statistics using Google Analytics Data
I wanted to bring statistics from Firebase to my website. To do this, I linked Firebase with Google Analytics in the settings in the "Integrations" tab
From there I copied the Property ID
...
0
votes
0
answers
67
views
How to transfer ownership of file create with service account using Drive API v3
I'm using the googleapis package in npmjs to create a spreadsheet as follows:
const { google } = require("googleapis")
const sheets = google.sheets("v4")
const drive = google.drive(...
0
votes
2
answers
34
views
Getting mimeType "octet stream" for a folder created with API
I'm creating a folder inside the appDataFolder with the google drive api as it follows:
const fileMetadata = {
'name': `folderName`,
'parents': ['appDataFolder']
};
const media ...
1
vote
0
answers
80
views
Gmail api with workload identity federation
I have created a workload identity pool with a third-party (auth0) provider. I have configured my service account with a domain-wide delegation and have enabled GMAIL API as well.
I could generate STS ...
0
votes
1
answer
106
views
How do I acknowledge an android in app purchase in nodeJS
At the moment, I am authenticating as my linked android apps google service account to verify and try to acknowledge android in app Subscriptions. I can verify them using the GET call, but when i make ...
0
votes
1
answer
8
views
Data Discrepancies between NodeJS Analytics client and Site
I've been following some of the GitHub resources from: https://github.com/googleapis/google-api-nodejs-client
The data being pulled from the API doesn't line up with the data shown on the Analytics ...
0
votes
1
answer
232
views
google People API error code: 400, Invalid JSON payload received
Hi guys am working on a projet the uses google people API to do crud operation on an authentiated user using nodejs and express server.
I was able to get all contacts, search for a particular contact ...
0
votes
0
answers
17
views
how can i fix the Err_packge_Path_not_Exported?
Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: No "exports" main defined in C:\Users\NAIM\Donya\node_modules\firebase\package.json?
0
votes
1
answer
25
views
How to navigate and use NodeJS SDK documentation in GCP?
What is the best index to find and navigate through documentation about NodeJS SDK documentation in GCP?
For AWS its https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/index.html and its so easy ...
1
vote
0
answers
87
views
How to convert audio.mp3 to audio.flac?
Google cloud speech to text only accepts flac or raw formatted audio files.
I want to convert an audio.mp3/wav file to audio.flac but the converter functions I am using is not working properly. Can ...
2
votes
1
answer
235
views
How To Use Google Drive API Without OAuth Using Nodejs?
After searching stackoverflow, blogs, YouTube, Google Drive API doc, e.t.c, most of the examples show how to use the Drive API using OAuth.
I want to build a Nodejs application where the Nodejs Server ...
0
votes
1
answer
86
views
How to fix Google API 'invalid_grant' error
I am using Google API with Drive API and Drive Activity API to handle and make changes to files.
Everything seems to work fine, but at random day of the week I receive an invalid_grant error. I have ...
1
vote
1
answer
216
views
Get access token using Refresh token through google API using NodeJS
when the callback URL is called I am getting the token from google API and store it in MongoDB.
exports.authorizedGoogle = async (req, res, next) => {
const oauth2Client = new google.auth.OAuth2(
...
0
votes
0
answers
41
views
Google Calendar API code not authenticating in Cloud Run
I've written a simple Calendar API call using the official NodeJS client: https://github.com/googleapis/google-api-nodejs-client#service-account-credentials
It works fine on my local machine, using a ...
0
votes
0
answers
38
views
Getting error `GaxiosError: TOO_MANY_ATTEMPTS_TRY_LATER` while using identityToolkit.relyingparty.sendVerificationCode in Nodejs
Getting error when calling sendVerificationCode.
Tech Stack Used : Nodejs:
async (req, res, next) => {
// #swagger.tags = ['Auth']
// #swagger.description = ' This endpoint allows to create a ...
0
votes
0
answers
23
views
Going through oauth2 not getting back a refresh token but getting back id token
I have an app that connects doctors with aptients.
I'm making an OAUTH request to google.
const {tokens} = await oauth2Client.getToken(request.query.code);
oauth2Client....
0
votes
1
answer
142
views
Do I need to refresh Google access token after a specific amount of time?
I'm using Google calendar nodejs api to create a calendar invite for an app that connects doctors with patients. Here's my code:
const defer = Q.defer();
oauth2Client.setCredentials({
...
0
votes
0
answers
48
views
How to check if the google access token has been revoked
I'm using the google node js api to check a user's availability. How do I check to see if the user's access token has been revoked? I would like to send him an email if that's the case.
Here's what I ...
1
vote
1
answer
103
views
How to revoke a user's google refresh token?
I let users connect their google calendar account to allow their patients to make appointments with them.
How can I revoke a user's refresh token using node js and the google calendar api? Sometimes ...
0
votes
1
answer
61
views
How to handle Refesh-Tokens with GoogleApis for NodeJS Client?
I'm looking at the following documentation:
https://github.com/googleapis/google-api-nodejs-client#handling-refresh-tokens
Especially this part:
oauth2Client.on('tokens', (tokens) => {
if (tokens....
0
votes
0
answers
58
views
How to access google sheets using default application credentials
Using a service account file to access google sheet is working as expected
import { google } from 'googleapis';
import serviceAccount from 'serviceKey.json';
const spreadsheetId = 'spreadsheet-id';
...
0
votes
1
answer
47
views
Google Publisher API in node JS to publish updated AAB, Nothing visible on play console
I'm using googleapis in node.js to publish my updated application. I've done everything like giving permission and enabling APIs. I've used following steps:-
Get an authorization token
Created new ...
1
vote
1
answer
56
views
Invalid grant error message and invalid tokens after a week
Environment details
Node version: v12.22.8
NPM version: 6.14.15
google apis version: 72.0.0
google auth library version: 7.0.4
environment variables: clientId, clientSecret, redirectUri
Issues
...
1
vote
1
answer
120
views
googleapi/drive in node.js
I am trying to integrate googleapi/drive using Node.js and also I need to integrate the API in React.js.
What issue I am facing into is that I am getting a couple of weird error messages in the front-...
-1
votes
1
answer
194
views
GaxiosError: Internal error Google App Engine
Every week my Google App Engine throws an error:
GaxiosError: Internal error
.Gaxios._request ( /workspace/node_modules/gaxios/build/src/gaxios.js:129 )
It happens once or twice per week, and takes my ...
0
votes
2
answers
36
views
Express GET returning an empty bracket
I'm trying to do an API using the Google Sheets API. But in my application I always get an empty array as response. These are my codes:
index.routes.js
import { Router } from "express";
...
2
votes
1
answer
265
views
Google Drive API - Invalid service account credentials
I am learning to use the Google Drive API and started with a small script isloated away from anything:
import * as fs from "fs";
import * as gdrive from "@googleapis/drive";
const ...
1
vote
1
answer
407
views
errorMessage: "Error: ENOENT: no such file or directory, open '/var/task/credentials.json'" errorType: "Runtime.UnhandledPromiseRejection"
I am working on a Next JS app using google Sheet api for a personal project. Now this works completely fine on my local. But when I am deploying it to Netlify, this error pops up.
Can someone put up a ...
0
votes
0
answers
78
views
Should i request access_token and refresh_token on every request or store them in a database? Google API's
So i've built a flutter app that require users to login via the google_sign_in flutter package. I send the serverToken to a Nodejs backend where i request a access_token and refresh_token for the ...
0
votes
2
answers
1k
views
"invalid_grant" / "bad request" while getting tokens for authcode google api
I'm trying to integrate google calendar in to my app, but getting an error: 'invalid_grant', error_description: 'Bad Request'
I've been following google documentation for the same and have referred to ...
0
votes
0
answers
68
views
Automatically switch language of Dialogflow Multilingual Chatbot
I want to switch dialogflow Agent's language automatically when user chooses the language or gives input as "English" or "हिन्दी", how can I do it using Dialogflow detectIntent ...
0
votes
0
answers
20
views
google sheets api batchUpdate how to add muilty data
Need help according to this guide but does not work for me anyone can help
https://developers.google.com/sheets/api/guides/values#writing_multiple_ranges
This is the function to get data from mongodb ...
0
votes
0
answers
30
views
How to exclude path from filename when file uploaded to firebase storage
I'm uploading a file with firebase storage to some/path/file.txt Later I get a download url and offer a download via link in browser. When a user downloads the file, it is named file.txt
const ...
1
vote
0
answers
60
views
Use NodeJS's 'googleapis' behind school proxy + npm
In my school I am using a laptop to code while I don't have lesssons.
Unfortunately I can't use 'googleapis' or 'npm install' since I get 'etimedout' errors.
I already know the proxy IP and the port, ...
0
votes
0
answers
29
views
How can I archive a thread using google-api-nodejs-client
I managed to authenticate and get my mail correctly. However, I want to directly archive one of my threads given the Id of the thread. Also, I cannot find features that allow me to mark as read/unread ...
1
vote
2
answers
66
views
I would like to know how to get the email address associated with the linked calendar
The application I'm developing is a google calender api, which does google calendar integration.
I would like to get the email address associated with the linked calendar, but I can't figure out how ...
0
votes
0
answers
34
views
Accessing a method of a Json object in NodeJs
I was doing debug related to certain portion of my code wasn't able to hit Google's API from my local machine, however the same code works fine when deployed on a server.
Looking at node-modules ...
0
votes
1
answer
203
views
Why is @google-cloud/profiler throwing 'permission_denied' errors when running inside a GKE instance?
I have been following the instructions on https://cloud.google.com/profiler/docs/profiling-nodejs#gke
to use the gcloud profiler for my nodejs application:
I added RUN npm install @google-cloud/...
0
votes
0
answers
71
views
How to Authenticate a Service Account for the Gmail API in Node Js?
So I'm using the Node.js Gmail library to send an email to another user. I was thinking of using a Service account to do just that. I've followed their documentation of passing the keyFile property ...
0
votes
0
answers
24
views
Put permissions on a sheet when create a spreadsheet with Google API
I am using Google's Spreadsheets API in NodeJS and I know how I can create a Spreadsheet with the following code
const auth = new GoogleAuth({
keyFile: 'src/credentials.json',
scopes: "...
1
vote
1
answer
76
views
How to make Video Uploaded to Youtube visible to the public
I was able to successfully upload a sample video to youtube using the Google API NodeJS Client library. But unfortunately, when I head over to Youtube, I noticed the Video is not visible to the public,...