multivendor-google-oauth
v0.0.1
Published
Framework-agnostic Google OAuth 2.0 client for authorization and user profile
Maintainers
Readme
multivendor-google-oauth
Framework-agnostic Google OAuth 2.0 client for building authorize URLs, exchanging authorization codes, and fetching user profiles.
Install
npm install multivendor-google-oauthUsage
import { GoogleOAuthClient } from 'multivendor-google-oauth';
const client = new GoogleOAuthClient({
clientId: process.env.GOOGLE_CLIENT_ID!,
clientSecret: process.env.GOOGLE_CLIENT_SECRET!,
callbackUrl: 'https://api.example.com/auth/google/callback',
});
const loginUrl = client.buildAuthorizeUrl({
redirectUrl: 'https://shop.example.com',
referralCode: 'REF123',
});
const { tokens, profile } = await client.completeOAuth(authorizationCode);License
MIT
