Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@privy-io/react-auth

Package Overview
Dependencies
Maintainers
7
Versions
1549
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@privy-io/react-auth

React client for the Privy Auth API

  • 1.97.0
  • npm
  • Socket score

Version published
Weekly downloads
13K
decreased by-49.75%
Maintainers
7
Weekly downloads
 
Created
Source

@privy-io/react-auth

pitch-2-slide-2

The Privy React Auth SDK allows you to authenticate your users with Privy in your React app.

Check out our demo!

Changelog

Our changelog contains the latest information about new releases, including features, fixes, and upcoming changes.

We use Semantic Versioning to track changes.

Installing

npm i @privy-io/react-auth

Basic Usage

Setup your integration by wrapping any React components that will use the Privy SDK with the PrivyProvider. This gives your wrapped components access to the Privy SDK and authentication context.

// Import the PrivyProvider
import {PrivyProvider} from '@privy-io/react-auth';

// Wrap any components that will use the Privy SDK with the PrivyProvider – for example, in your `app` or `index` file
<PrivyProvider
  appId="APP_ID_FROM_DASHBOARD"
  onSuccess={(user) => console.log(`User ${user.id} logged in!`)}
>
  <Component {...pageProps} />
</PrivyProvider>;

Now, from within your React components, you can access the Privy SDK via the usePrivy hook!

// Import the usePrivy hook
import {usePrivy} from '@privy-io/react-auth';

// Call usePrivy() from inside your React components
const {ready, authenticated, user, login, logout} = usePrivy();

Keywords

FAQs

Package last updated on 13 Dec 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc