Skip to content

Instantly share code, notes, and snippets.

@orgsofthq
orgsofthq / gauth.ts
Last active January 14, 2022 05:42
import { create, Header, Payload } from "https://deno.land/x/djwt@v2.4/mod.ts";
// License: MIT
// How to get an access token from Google Cloud using Deno
//
// Usage:
// const token = await getAccessToken(config)
type Config = {
privateKey: string; // Private base64 encoded RSA key, starts with -----BEGIN PRIVATE KEY-----