re.al docs
  • Introduction
    • Get to Know re.al
    • Relationship to Arbitrum
    • Tokenized RWAs on re.al
  • re.al Chain
    • Arbitrum Orbit Overview
    • Block Explorer
    • Run a Node
    • Governance
    • Security
    • Contracts & Addresses
  • Get Started
    • reETH: Native Token
    • Get Started
    • Asset Bridging
    • Network Guides and Videos
      • How to Bridge to re.al
      • How to Lock $RWA
      • How to Bridge from re.al (to Ethereum and L2s)
  • RWA Token
    • Overview
    • RWA Tokenomics
      • Reporting veRWA APY
    • Managing veRWA
    • stRWA and wstRWA
    • RWA Rewards Program
      • Overview and Goals
      • Program Specifics
      • Referrals
      • Calculating Points
    • Migration
    • Contracts
      • RWA Technical
      • stRWA Technical
  • Build on re.al
    • Start Building
    • Faucet
    • Smart Contracts
      • Write a Contract
      • Deploy Using Hardhat
      • Verify Contracts
  • Services
    • Services
    • Account Abstraction
      • Safe Account Abstraction
    • Automation & Off-chain Data
      • Gelato Web3 Functions
    • Bridges
      • Layer Zero
    • Indexers
      • Goldsky
    • Oracles
      • Redstone on re.al
    • Relay
      • Gelato Relay
    • VRF
      • Gelato VRF
    • Wallet as a Service
      • Privy
      • Web3Auth
Powered by GitBook
On this page
  • Quickstart
  • 1. Installation
  • 2. Get API Keys
  • 3. Setting up your App
  • Just usePrivy!
  1. Services
  2. Wallet as a Service

Privy

Quickstart

The Privy React Auth SDK simplifies user authentication in React apps, providing tools for various login methods and user management.

1. Installation

Install the SDK using npm:

npm install @privy-io/react-auth

2. Get API Keys

Retrieve your Privy app ID from the developer console.

3. Setting up your App

You have to define a custom chain configuration in so it can be used with PrivyProvider

import { defineChain } from "viem-15";
export const config = {
  unreal: {
    privyConfig: defineChain({
      id: 18231,
      network: "unreal",
      name: "Unreal",
      nativeCurrency: {
        name: "unreal Ether",
        symbol: "ETH",
        decimals: 18,
      },
      rpcUrls: {
        public: {
          http: ["https://rpc.unreal.gelato.digital"],
        },
        default: {
          http: ["https://rpc.unreal.gelato.digital"],
        },
      },
      blockExplorers: {
        default: {
          name: "Block Scout",
          url: "https://unreal.blockscout.com/",
        },
      },
      contracts: {
        multicall3: {
          address: "0xca11bde05977b3631167028862be2a173976ca11",
          blockCreated: 31317,
        },
      },
      testnet: true,
    }),
    privyId: "YOUR_PRIVY_ID",
    zeroDevId: "ZERODEV_ID",
    simpleCounter: "0x47A9064a8D242860ABb43FC8340B3680487CC088",
  },
};
// Example for NextJS
import { PrivyProvider } from "@privy-io/react-auth";
// ... other imports

function MyApp({ Component, pageProps }) {
  // ... setup
  return (
    <PrivyProvider appId="your-app-id" /* ...other config */>
      {/* ... rest of your app */}
    </PrivyProvider>
  );
}

// Example for Create React App
import { PrivyProvider } from "@privy-io/react-auth";
// ... other imports

const root = ReactDOM.createRoot(document.getElementById("root"));
root.render(
  <React.StrictMode>
    <PrivyProvider appId="your-app-id" defaultChain: config[raasNetwork].privyConfig,
                supportedChains: [config[raasNetwork].privyConfig], /* ...other config */>
      <App />
    </PrivyProvider>
  </React.StrictMode>
);

Just usePrivy!

PreviousWallet as a ServiceNextWeb3Auth