# googleworkspace/apps-script-oauth2

An OAuth2 library for Google Apps Script.

Repository: https://github.com/googleworkspace/apps-script-oauth2
Canonical: https://ross.abutalabs.com/products/apps-script-oauth2
Homepage: https://developers.google.com/apps-script/
Language: JavaScript
License: Apache-2.0
License Family: permissive
Topics: oauth, google-apps-script, gsuite, apps-script, google-workspace
Last push: 2026-06-16T13:10:18+00:00

## Health v2 (maintenance only)
Score: 62/100 (v2, computed 2026-09-03T02:20:16.233290+00:00)
- activity 87, release rhythm 8, longevity 100
- inputs: {"age_days": 4405, "days_push": 78, "days_rel": null, "gap_med": null, "n_releases_24m": 0}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 1744, forks 457 (observed 2026-08-28T04:05:30.582176+00:00)

## What it is
An OAuth2 library for Google Apps Script that creates, authorizes, and refreshes OAuth2 tokens using Apps Script's StateTokenBuilder and /usercallback endpoint. It lets Apps Script projects authenticate against any OAuth2 provider, including Google and third-party APIs.

## Use cases
- authenticate a Google Apps Script against a third-party OAuth2 API
- refresh expired OAuth2 access tokens in Apps Script
- connect Apps Script to services not covered by built-in or advanced services
- handle OAuth2 redirect callbacks in a Google Workspace add-on
- store and reuse OAuth2 tokens across script executions

## When to choose
- your Apps Script needs OAuth2 access to an API without built-in Apps Script support
- you need token refresh handling in a Google Workspace automation
- you want a maintained, Google-published library for OAuth flows in Apps Script

## When to avoid
- you only call Google APIs covered by built-in or advanced Apps Script services
- you can simply declare scopes in the manifest and use ScriptApp.getOAuthToken()
- you are not working within Google Apps Script

## Facets
- artifact type: library
- maturity: active
- function: auth, http-client, developer-tools
- domain: apis, web-development
- platform: cloud
- tags: oauth2, google-apps-script, token-management, google-workspace, authorization-flow, automation, web-server, javascript

## Member repositories
- googleworkspace/apps-script-oauth2 (main) score 62

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:05:30.582176+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-30T03:29:28.596954+00:00, confidence not recorded.
  - readme: https://github.com/googleworkspace/apps-script-oauth2 (fetched 2026-08-28T04:05:30.582176+00:00, sha ecbbb46eb5e0)
  - homepage: https://developers.google.com/apps-script/ (fetched 2026-08-29T11:07:23.038177+00:00, sha 63a42a5299f0)
- Data as of 2026-08-30T08:39:29.467469+00:00.
