@radzor/oauth-token-refresh
Automatic OAuth 2.0 access token refresh and lifecycle management. Handles token expiry detection, background refresh, secure storage, and provider-specific quirks for Google, GitHub, Discord, Stripe, and custom providers.
Install
View source on GitHub →Inputs
| Name | Type | Default | Description |
|---|---|---|---|
| clientId* | string | — | OAuth application client ID. |
| clientSecret* | string | — | OAuth application client secret.GOOGLE_CLIENT_SECRET |
| tokenEndpoint | string | — | Provider token endpoint URL. Omit to use a preset provider. |
| provider | 'google' | 'github' | 'discord' | 'stripe' | 'custom' | custom | Known provider preset. Sets tokenEndpoint and quirks automatically. |
| refreshBuffer | number | 300 | Seconds before expiry to proactively refresh the token. |