Modern React components and hooks for seamless Facebook SDK integration. Type-safe, performant, and developer-friendly.
Real Facebook components working with live data - no setup required
<Login scope={['email', 'public_profile']} onSuccess={(response) => console.log('Success!', response)} onError={(error) => console.log('Error!', error)}> Login with Facebook</Login>
<Share href="https://github.com/seeden/react-facebook" layout="box_count" size="large"/>
<EmbeddedVideo href="https://www.facebook.com/Meta/videos/1038522214125952" showText={false} autoPlay={false}/>
Opens browser console to show tracking
const { track } = usePixel();
// Track a purchaseawait track('Purchase', { value: 29.99, currency: 'USD'});
Install the package
npm install react-facebook
Add FacebookProvider to your app
Wrap your app with the provider component
Start using components
Import and use any Facebook component
1import { FacebookProvider, Login, useFacebook } from 'react-facebook';2
3function App() {4 return (5 <FacebookProvider appId="YOUR_APP_ID">6 <Login7 scope={['email', 'public_profile']}8 onSuccess={(response) => console.log('Login Success!', response)}9 onError={(error) => console.log('Login Failed!', error)}10 >11 Login with Facebook12 </Login>13 </FacebookProvider>14 );15}
Optimized bundle size with lazy loading and tree-shaking support
Full TypeScript support with comprehensive type definitions
Pre-built components for login, share, like, and more
Built with hooks, context, and latest React patterns
Built-in internationalization with dynamic locale switching
Integrated Facebook Pixel tracking for analytics
Pre-built, customizable components for all Facebook SDK features
Facebook login with customizable UI
Share button with custom styling
Share dialog for Facebook
Facebook like button
Embedded Facebook comments
Get comment count for URLs
Embed Facebook page plugin
Embed Facebook posts
Embed Facebook videos
Join the growing community of companies and developers building amazing experiences with react-facebook
Trusted by companies worldwide
From startups to enterprise applications, react-facebook powers social integrations for millions of users globally.
Measurable business results
Companies report improved user engagement, reduced development time, and seamless Facebook integration experiences.
Are you using react-facebook in production? We'd love to showcase your implementation and help other developers discover proven solutions.
Looking for companies using this library • Privacy respected
Join the community of developers and companies building with React Facebook