<!-- Canonical: https://docs.linea.build/network/build/tools/social-login/privy -->

> For the complete Linea documentation index, see [llms.txt](/llms.txt).
> Agents can fetch this page as Markdown at [https://docs.linea.build/network/build/tools/social-login/privy.md](https://docs.linea.build/network/build/tools/social-login/privy.md).

# Privy

Privy provides comprehensive social login authentication for web3 applications, enabling users to create embedded wallets through familiar social platforms.

## Supported social providers

Privy supports authentication through many popular social platforms:

-   Apple
-   Discord
-   Farcaster
-   GitHub
-   Google
-   LinkedIn
-   Telegram
-   TikTok
-   X

For X, Privy supports both OAuth 2.0 and OAuth 1.0a authentication flows, providing flexibility based on your application's needs.

## How social login works

When users choose social authentication, Privy handles the complete OAuth flow:

1.  Provider selection: Users select their preferred social platform
2.  OAuth redirect: Secure redirect to the chosen social provider's authentication page
3.  Permission approval: Users approve access permissions on the familiar social platform
4.  Account creation: Privy creates a user profile linked to their social account
5.  Wallet generation: An embedded wallet is automatically created for web3 interactions
6.  Token management: Optional OAuth tokens returned for additional API access

## Setup and configuration

### Section 1. Enable social providers

Configure social authentication in the [Privy Dashboard](https://dashboard.privy.io):

1.  Find the "User management" section in the dashboard sidebar
2.  Click on "Authentication"
3.  Navigate to the "Socials" tab
4.  Toggle on any desired social platforms.

### Section 2. OAuth credential options

Next to each social provider, you can see a dropdown that enables you to access OAuth configuration. Privy offers two approaches for OAuth configuration:

-   Default credentials: Use Privy's pre-configured OAuth credentials for quick setup and testing. This is perfect for development and getting started quickly.
-   Custom credentials: Configure your own OAuth applications for production use. This provides better security, branding control, and eliminates shared rate limits.

See the [Privy guide](https://docs.privy.io/basics/get-started/dashboard/configure-login-methods#configure-your-oauth-credentials) to learn how to set up OAuth credentials with each provider.

Benefits of custom credentials:

-   Your app branding appears on social login screens
-   Better security and application control
-   Dedicated rate limits for your application
-   Enhanced resiliency and reliability

### Section 3. SDK integration

With configuration done, you can implement the Privy SDK and widget into your dapp.

First, install the Privy SDK:

```bash
npm install @privy-io/react-auth
```

There are many SDK flavours, depending on which language you're using.

Now wrap your app in the `PrivyProvider`:

```jsx
import { PrivyProvider } from '@privy-io/react-auth';

export default function App() {
  return (
    <PrivyProvider
      appId="your-privy-app-id"
      config={{
        // Configure which login methods to show
        loginMethods: ['email', 'wallet', 'google', 'twitter', 'discord'],
        // Customize the authentication experience
        appearance: {
          theme: 'light',
          accentColor: '#676FFF',
        },
      }}
    >
      {/* Your app components */}
    </PrivyProvider>
  );
}
```

## Resources

-   Visit the [Privy Dashboard](https://dashboard.privy.io) to configure social authentication
-   Review [OAuth provider setup guides](https://docs.privy.io/basics/get-started/dashboard/configure-login-methods#social-providers) for platform-specific configuration
-   Explore [embedded wallets](https://docs.privy.io/guide/react/wallets/embedded) for seamless web3 integration
-   Check out the [Privy documentation](https://docs.privy.io) for advanced configuration options
