Skip to main content

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

1. Enable social providers

Configure social authentication in the Privy Dashboard:

  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.

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 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

3. SDK integration

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

First, install the Privy SDK:

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:

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

Want to be featured here?
Have you built a tool for Linea? Contribute to the docs to add it here! See our guide to contributing.