Google OAuth & Cloudflare Workers
Background
This is a simple JS module used to facilitate OAuth2 flow from within a Cloudflare Worker. This module isn't specific to Cloudflare, but it is compatible within isolates and doesn't rely on NodeJS.
Usage
Install: npm i cloudflare-workers-and-google-oauth
// import the lib
import GoogleAuth, { GoogleKey } from 'cloudflare-workers-and-google-oauth'
// ensure you have global access to the environment variable representing the PEM-encoded secret
// you downloaded from Google Cloud dashboard for your service account
export interface Env {
GCP_SERVICE_ACCOUNT: string;
}
...