Registry / auth-security / netlify-auth-providers

netlify-auth-providers

JSON →
library1.0.0-alpha5jsnpmunverified

Netlify Auth Providers is an alpha-stage library (v1.0.0-alpha5) for authenticating with Netlify's external OAuth providers. It provides a simple client that handles the authentication flow, token storage, and refresh. As an alpha release, the API is unstable and may change without notice. Key differentiators include direct integration with Netlify's Identity service and minimal configuration required.

npm install netlify-auth-providers
INSTALL
IMPORT
SIG · NETLIFY-AUTH-PROVI
N
netlify-auth-providers
auth-securityjavascriptv1.0.0-alpha5
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

default
import NetlifyAuthProviders from 'netlify-auth-providers'
const NetlifyAuthProviders = require('netlify-auth-providers')
ESM-only package; CommonJS require is not supported.
Authenticator
import { Authenticator } from 'netlify-auth-providers'
Exported class for managing OAuth flows.
TokenStore
import { TokenStore } from 'netlify-auth-providers'
Interface for custom token storage; not exported in earlier alphas.

Demonstrates initializing the client, starting OAuth, handling callback, and retrieving token.

import NetlifyAuthProviders from 'netlify-auth-providers'; const client = new NetlifyAuthProviders({ provider: 'github', clientId: process.env.GITHUB_CLIENT_ID ?? '', redirectUri: 'http://localhost:8888/callback' }); // Start OAuth flow client.authenticate(); // After redirect, handle callback client.handleCallback(); // Get access token const token = client.getToken(); console.log({ token });
Debug
Known issues
breakingAlpha release: no stable API; breaking changes occur without warning.
fix
Pin to exact version and test each upgrade.
affects: <=1.0.0-alpha5
deprecatedPackage is deprecated in favor of netlify-identity-widget or direct Identity API.
fix
Migrate to netlify-identity-widget for UI integration or use Netlify Identity JS client.
affects: all
gotchaOAuth redirect must be handled on the same origin; CORS errors occur if mismatched.
fix
Ensure redirectUri matches the exact page where handleCallback is called.
affects: all
gotchaToken storage defaults to localStorage; may not be available in SSR environments.
fix
Implement custom TokenStore that uses cookies or other storage.
affects: all
Errors
Common errors & fixes
TypeError: netlify_auth_providers_1.default is not a constructor
Using CommonJS require on an ESM-only package.
fix
Use ES module import syntax (import ... from).
Error: Could not find provider 'github'. Available providers: []
Provider list not initialized or incorrect provider name.
fix
Specify provider in options object (case-sensitive).
OAuth callback failed: invalid redirect_uri
Redirect URI does not match Netlify app settings.
fix
Ensure the redirectUri matches exactly what is configured in Netlify dashboard.
Upgrade
Version history
1.0.0-alpha5latest on npm
Audit
Dependencies
netlifyrequireduses Netlify client and typings
Agent activity
18 hits · last 30 days
node
14
OpenAI (training)
2
Amazon
1
Resources
netlify-auth-providers — npm install netlify-auth-providers · libregistry