keyPrivy

Set up Privy with Seismic for email and social login

Privy provides email, social, and embedded wallet authentication. This guide shows how to integrate Privy with Seismic React for apps that need flexible onboarding beyond browser extension wallets.

Prerequisites

npm install @privy-io/react-auth @privy-io/wagmi wagmi viem @tanstack/react-query seismic-react seismic-viem
circle-info

You need a Privy App ID from the Privy Dashboardarrow-up-right.

Step 1: Configure Privy with Seismic Chain

Define the Seismic chain configuration for Privy:

import { seismicTestnet } from "seismic-react/rainbowkit";

// Privy needs the chain in viem format
const seismicChain = {
  id: seismicTestnet.id,
  name: seismicTestnet.name,
  nativeCurrency: seismicTestnet.nativeCurrency,
  rpcUrls: seismicTestnet.rpcUrls,
  blockExplorers: seismicTestnet.blockExplorers,
};

Step 2: Set Up wagmi Config

Create a wagmi config using Privy's wagmi integration:

Step 3: Set Up Providers

Nest the providers in the correct order -- Privy wraps wagmi, and ShieldedWalletProvider goes inside:

circle-info

Privy's embedded wallets work seamlessly with Seismic -- users don't need a browser extension. Privy creates a wallet automatically when users sign in with email or social accounts.

Step 4: Add Login Button

Use Privy's hooks to trigger the login modal:

Step 5: Use Shielded Hooks

Once authenticated, use seismic-react hooks as normal:

Complete Example

See Also

Last updated