JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 1650
  • Score
    100M100P100Q126932F
  • License MIT

Enables easier interfacing with GCS OAuth API for use in Cloudflare Workers

Package Exports

  • cloudflare-workers-and-google-oauth
  • cloudflare-workers-and-google-oauth/dist/index.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (cloudflare-workers-and-google-oauth) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

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;
}

...