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.

This client comes with an OAuth2 client that allows you to retrieve an access token and refreshes the token and re-try the request seamlessly if token is expired. The basics of Google's OAuth 2.0 implementation is explained on Google Authorization and Authentication documentation.

Note: This library is currently in alpha status.

The project's home page can be found on GitHub

816 questions
25
votes
2 answers

Gmail API for sending mails in Node.js

Disclaimer: I have followed Google's own Node.js quickstart guide and successfully connect and use the gmail.users.labels.list() functionality. I have checked for questions/answers here, like this one (that is not using the Node.js API I am asking…
Sergio
  • 28,539
  • 11
  • 85
  • 132
18
votes
2 answers

Call Google Play Developer API from Firebase Functions

I am trying to develop a server-side validation of my users' in-app purchases and subscriptions as recommended, and I want to use Firebase Functions for that. Basically it has to be an HTTP trigger function that receives a purchase token, calls the…
17
votes
1 answer

Google Page Speed Insights - Basic Authentication

I am current using npm psi to do psi tests against a site which is publicly accessible (except with basic authentication). All of my attempts to use the username:password@ convention have failed me thus far for psi and psi only. I was wondering if I…
jshthornton
  • 1,284
  • 11
  • 29
16
votes
2 answers

Accessing a public calendar using Google API without requiring a user to log in

I'd like to access a public calendar using Google's REST API. Google's calendar API suggests I need an OAuth token to get access to calendars: https://developers.google.com/google-apps/calendar/auth However, I'm accessing a public calendar and am…
15
votes
4 answers

Error: error:1E08010C:DECODER routines::unsupported with Google auth library

I've recently ran into this error with the google cloud storage SDK on Node.js. I know for a fact that this worked in the past without any changes, but I haven't touched the code in a while and might be wrong. Here's the error itself: Error:…
Fares
  • 893
  • 1
  • 11
  • 24
13
votes
3 answers

nodejs googleapis, authClient.request is not a function

I am creating an oauth2client in one function like so and returning it. I actually do pass in the clien id, secret, redirect url, and credentials. Those are all correct from what I have checked. var OAuth2 = google.auth.OAuth2; var oauth2Client =…
13
votes
1 answer

Failed sending mail through google api in nodejs

I'm trying to send an email through Google API. I'm using googleapis for Google API access in node.js . My issue is that when I try to send a simple mail with no attachments, I get the following error: 'raw' RFC822 payload message string or…
12
votes
1 answer

Error authenticating with JWT and googleapis (error:0906D06C:PEM routines:PEM_read_bio:no start line)

I am trying to connect to Google Analytics Reporting API v4 from my Node server (running as a Firebase Cloud Function). I want to authenticate using JWT, as per this example: http://nali.org/google-analytics-v4-api-node-js-starter-example/ However I…
12
votes
1 answer

Get access token on server side javascript (nodejs) using google authorization code received from client side

i have gone through this documentation :- https://developers.google.com/identity/sign-in/web/server-side-flow At the last step it receives the authorization code and after that it shows the example of receiving access token and refresh token using…
11
votes
1 answer

Accessing Gmail API through Cloud Functions

I'm attempting to build an email parser that responds to a gmail pubsub message. I am currently able to receive and parse the pubsub message and extract the historyId, but I'm having trouble authenticating my request to the gmail api. Here's what I…
10
votes
1 answer

Access google connections using google people API

I would like to fetch all the google private connections of a user signed in from my app. I've enabled the Google People and the Google Plus API's. I set up the credentials API key, client id & client secret. The url with which I'm trying to fetch…
10
votes
2 answers

Move/rename folder in Google Cloud Storage using nodejs gcloud api

I am trying to rename or move a folder in google cloud storage using the gcloud api. A similar question explains how to delete a folder: Delete folder in Google Cloud Storage using nodejs gcloud api But how can one rename a folder? or move to…
tomermes
  • 22,950
  • 16
  • 43
  • 67
10
votes
2 answers

With the npm package googleapis how do I get the user's email address after authenticating them?

I'm using this npm library - https://www.npmjs.com/package/googleapis and I'm using the following Express routes as /user/: /* Redirect to the google login page */ router.get('/login', function (req, res) { res.redirect(auth.generateUrl()); …
Gnuffo1
  • 3,478
  • 11
  • 39
  • 53
9
votes
2 answers

Single flow: sign user in via Google oAuth AND grant offline/server access?

I'm trying to implement Google sign-in and API access for a web app with a Node.js back end. Google's docs provide two options using a combo of platform.js client-side and google-auth-library server-side: Google Sign-In with back-end auth, via…
9
votes
2 answers

How do you use Google API getRequestHeaders() to get an OAuth2 access token?

I'm using the googleapis npm library to authorize using OAuth2 to access my Gmail account to send emails. I am using the following code (TypeScript) to do that: const oAuth2Client = new google.auth.OAuth2( googleConfig.clientId, …
derefed
  • 679
  • 5
  • 17
1
2 3
54 55