multivendor-facebook-oauth
v0.0.1
Published
Framework-agnostic Facebook OAuth 2.0 client for authorization and user profile
Maintainers
Readme
multivendor-facebook-oauth
Framework-agnostic Facebook OAuth 2.0 client for building authorize URLs, exchanging authorization codes, and fetching user profiles via the Graph API.
Install
npm install multivendor-facebook-oauthUsage
import { FacebookOAuthClient } from 'multivendor-facebook-oauth';
const client = new FacebookOAuthClient({
appId: process.env.FACEBOOK_APP_ID!,
appSecret: process.env.FACEBOOK_APP_SECRET!,
callbackUrl: 'https://api.example.com/auth/facebook/callback',
});
const loginUrl = client.buildAuthorizeUrl({
redirectUrl: 'https://shop.example.com',
referralCode: 'REF123',
});
const { tokens, profile } = await client.completeOAuth(authorizationCode);License
MIT
