Google-api-nodejs-client: `new google.auth.JWT(config)` fails - google.auth is undefined

Created on 23 Jun 2018  路  2Comments  路  Source: googleapis/google-api-nodejs-client

The samples and documentation show that you can create a JWT client using

wtClient = new google.auth.JWT(

...but google.auth is undefined.

samples/directory_v1/group-delete.js

needs more info question

Most helpful comment

Sorry, this was my fault. I was using const google = require('googleapis'); instead of const { google } = require('googleapis');

When I looked in the code I did not see auth exported in index.js, but it seems to be working regardless.

All 2 comments

Greetings! Can you share a full code sample? How exactly are you running the sample? You may need to run npm link && npm link googleapis before trying the sample :)

Sorry, this was my fault. I was using const google = require('googleapis'); instead of const { google } = require('googleapis');

When I looked in the code I did not see auth exported in index.js, but it seems to be working regardless.

Was this page helpful?
0 / 5 - 0 ratings