React FacebookSDK Integration Made Simple

Modern React components and hooks for seamless Facebook SDK integration. Type-safe, performant, and developer-friendly.

See It In Action

Real Facebook components working with live data - no setup required

Facebook Login

<Login
scope={['email', 'public_profile']}
onSuccess={(response) => console.log('Success!', response)}
onError={(error) => console.log('Error!', error)}
>
Login with Facebook
</Login>

Share Button

<Share
href="https://github.com/seeden/react-facebook"
layout="box_count"
size="large"
/>

Embedded Video

<EmbeddedVideo
href="https://www.facebook.com/Meta/videos/1038522214125952"
showText={false}
autoPlay={false}
/>

Facebook Pixel Tracking

Opens browser console to show tracking

const { track } = usePixel();
// Track a purchase
await track('Purchase', {
value: 29.99,
currency: 'USD'
});

Quick Start

Get up and running in minutes

  1. 1

    Install the package

    npm install react-facebook
  2. 2

    Add FacebookProvider to your app

    Wrap your app with the provider component

  3. 3

    Start using components

    Import and use any Facebook component

App.tsx
1import { FacebookProvider, Login, useFacebook } from 'react-facebook';
2
3function App() {
4 return (
5 <FacebookProvider appId="YOUR_APP_ID">
6 <Login
7 scope={['email', 'public_profile']}
8 onSuccess={(response) => console.log('Login Success!', response)}
9 onError={(error) => console.log('Login Failed!', error)}
10 >
11 Login with Facebook
12 </Login>
13 </FacebookProvider>
14 );
15}

Why Choose React Facebook?

Lightning Fast

Optimized bundle size with lazy loading and tree-shaking support

Type Safe

Full TypeScript support with comprehensive type definitions

Social Components

Pre-built components for login, share, like, and more

Modern React

Built with hooks, context, and latest React patterns

i18n Support

Built-in internationalization with dynamic locale switching

Facebook Pixel

Integrated Facebook Pixel tracking for analytics

Rich Component Library

Pre-built, customizable components for all Facebook SDK features

Login

Facebook login with customizable UI

ShareButton

Share button with custom styling

Share

Share dialog for Facebook

Like

Facebook like button

Comments

Embedded Facebook comments

CommentsCount

Get comment count for URLs

Page

Embed Facebook page plugin

EmbeddedPost

Embed Facebook posts

EmbeddedVideo

Embed Facebook videos

Who's Using React Facebook?

Join the growing community of companies and developers building amazing experiences with react-facebook

Production Ready

Trusted by companies worldwide

From startups to enterprise applications, react-facebook powers social integrations for millions of users globally.

Real Impact

Measurable business results

Companies report improved user engagement, reduced development time, and seamless Facebook integration experiences.

Share Your Success Story

Are you using react-facebook in production? We'd love to showcase your implementation and help other developers discover proven solutions.

Get featured on our website
Build community credibility
Help shape future development
Share Your Story

Looking for companies using this library • Privacy respected

Ready to integrate Facebook into your React app?

Join the community of developers and companies building with React Facebook