Hey All,
I’m trying to get some authorization set up to use the Google BigQuery API for my app. It needs oAuth2 or a Service Account authorization and it seems the easiest way to go is to use their Google Auth Library for NodeJS.
I’ve installed it via NPM, and just trying to run the basic code to access my JSON Web Token.
My question is just around using JS files that have the ‘require’ syntax, not sure how to use in wappler to require the google-auth-library installed in the node-modules folder.
Here’s a snippet i’m trying as per the google docs:
const { JWT } = require('google-auth-library');
const keys = require('./auth.json');
I’ve also tried:
const { JWT } = require('../node_modules/google-auth-library');
const keys = require('./auth.json');
But I’m getting this error message in the console:
auth.js:1 Uncaught ReferenceError: require is not defined at auth.js:1
Any thoughts or general direction on this? is ‘require’ ES6 syntax that isn’t supported? Is it just a matter of getting the right address in the require statement?