@nexpress/oauth-providers
v0.4.6
Published
OAuth provider factories for NexPress — Google, GitHub, Discord. Framework-shipped, plugin-free.
Maintainers
Readme
@nexpress/oauth-providers
Framework-shipped OAuth provider factories for Google, GitHub, and Discord. They normalize provider profiles into the NexPress OAuth contract without requiring a plugin wrapper or generic OAuth runtime dependency. Each bundled provider uses S256 PKCE and validates token responses before reading a profile.
Install
pnpm add @nexpress/oauth-providersimport { createGoogleOAuthProvider } from "@nexpress/oauth-providers";
const clientId = process.env.NP_OAUTH_GOOGLE_CLIENT_ID;
const clientSecret = process.env.NP_OAUTH_GOOGLE_CLIENT_SECRET;
if (!clientId || !clientSecret) throw new Error("Google OAuth credentials are required");
const provider = createGoogleOAuthProvider({
clientId,
clientSecret,
});Google and Discord only expose verified email addresses to identity matching. GitHub falls back to the verified-email endpoint when the public profile hides its primary address. Apps register the returned provider through their normal NexPress bootstrap or plugin setup.
Links
License
MIT
