Skip to main content
Privy is a third-party service that allows users to login using their email or social accounts (Google, Facebook, Twitter, etc). Upon login, a NEAR wallet is created for the user, which they can fund and use to interact with your dApp.
See full working example here
Web3Auth For an alternative social login method you can check Web3Auth. We have a functional Web3Auth Integration Example to show how to integrate Web3Auth into your web app.

Installation

Choose whether to expose your Privy wallet through NEAR Connect or integrate Privy directly into your application:
Install the plugin, NEAR Connect, and the UI packages used by the signing page:

Which should I choose?

Using NEAR Connect would give your application access to all NEAR Wallets that support NEAR Connect, plus social login with Privy. This will provide an experience closer to Web3 applications. Integrating Privy directly would make your application support only social login (through Privy). This should be the preferred way for applications that want to abstract away the wallet and provide a Web2-like experience to their users.

Setup

privy-near-connect lets you expose a Privy embedded wallet through NEAR Connect.
1

Create a Privy app

Create an application in the Privy dashboard and copy its App ID and Client ID. Store both values in your application’s environment variables:
2

Publish a wallet manifest

Add manifest.json to your application’s public directory. Replace the example URLs and wallet metadata with your own:
Keep the executor URL pinned to an immutable commit SHA. NEAR Connect fetches and runs this script at runtime, so you should update the SHA deliberately when adopting a new executor build.
3

Create the signing page

Add a /sign route and render the plugin’s signing component there:
allowedOrigins limits which applications can send requests to the signing page. Add every dApp origin that should be able to use the wallet.
4

Load the plugin with NEAR Connect

Initialize NearConnector with the manifest you created:
That’s it! The plugin will now be available in the NEAR Connect modal.
Continue with the wallet login tutorial to connect the wallet and use it from your dApp.