@nixjs23n6/facebook-login
v1.0.2
Published
Facebook signin for React using the official Facebook JS SDK.
Downloads
9
Maintainers
Readme
@nixjs23n6/facebook-login
A Component React for Facebook Login
Quick Setup
Install
Install these dependencies:
yarn add @nixjs23n6/facebook-login
Setup & Usage
import { Sdk, useInitFacebook } from '@nixjs23n6/facebook-login'
interface LoginPropArg {}
export const Login: React.FC<LoginPropArg> = () => {
useInitFacebook({
version: 'v11.0',
appId: __FACEBOOK_APP_ID__
})
const onLogin = () => {
Sdk.login({
scope: 'public_profile,email'
})
.then(console.log)
.catch(console.log)
}
return (<button onClick={() => onLogin()}>Login with facebook</button>)
}