๐—š๐—ผ๐—ผ๐—ด๐—น๐—ฒ ๐—”๐˜‚๐˜๐—ต ๐—œ๐—ป ๐—ก๐—ผ๐—ฑ๐—ฒ ๐—๐—ฆ ๐—ช๐—ถ๐˜๐—ต๐—ผ๐˜‚๐˜ ๐—ฃ๐—ฎ๐—ฐ๐—ธ๐—ฎ๐—ด๐—ฒ๐˜€

The googleapis package is common for Node.js. It is heavy. It adds 450 dependencies to your project. You do not need this for a simple CI script.

I wrote a script for the Search Console API. It is 60 lines long. It uses built-in Node.js tools. It adds zero packages to the repo.

The process is simple:

Keep these tips in mind:

This method is best for simple scripts. It keeps your code clean.

Use a library if:

Knowing the raw flow helps you debug. You see how the JWT becomes a token. This makes you faster.

Source: https://dev.to/morinaga/rolling-a-google-service-account-jwt-in-nodejs-without-the-googleapis-package-pig