Skip to main content
Reown AppKit streamlines Web3 wallet integration by offering seamless authentication through email and social logins, built-in fiat on-ramps, smart contract accounts, and user notifications, delivering a complete toolkit for creating engaging blockchain applications. You can use Node RPC as chain provider, by using Wagmi’s createConfig and setting Node RPCs in transports array.
1
RPC Configuration
2
  • Add the following configuration to config/index.ts to use Tenderly RPC.
  • Set the following environment variables:
    • NEXT_PUBLIC_TENDERLY_NODE_ACCESS_KEY_MAINNET
    • NEXT_PUBLIC_PROJECT_ID
  • 3
    
    // Get projectId from https://cloud.reown.com
    export const projectId = process.env.NEXT_PUBLIC_PROJECT_ID
    
    if (!projectId) {
      throw new Error('Project ID is not defined')
    }
    
    export const networks = [mainnet, arbitrum]
    
    //Set up the Wagmi Adapter (Config)
    export const wagmiAdapter = new WagmiAdapter({
      storage: createStorage({
        storage: cookieStorage
      }),
      ssr: true,
      transports: {
        [mainnet.id]: http(process.env.NEXT_PUBLIC_TENDERLY_NODE_ACCESS_KEY_MAINNET!)
      },
      networks,
      projectId
    })
    
    export const config = wagmiAdapter.wagmiConfig
    
    4
    Create the ContextProvider
    5
    Create Reown AppKit ContextProvider you can use in the rest of your UI to connect to selected networks.
    6
    'use client'
    
    
    
    // Set up queryClient
    const queryClient = new QueryClient()
    
    if (!projectId) {
      throw new Error('Project ID is not defined')
    }
    
    // Set up metadata
    const metadata = { //this is optional
      name: "appkit-example",
      description: "AppKit Example - EVM",
      url: "https://exampleapp.com", // origin must match your domain & subdomain
      icons: ["https://avatars.githubusercontent.com/u/37784886"]
    }
    
    // Create the modal
    const modal = createAppKit({
      adapters: [wagmiAdapter],
      projectId,
      networks: [mainnet, arbitrum],
      metadata: metadata,
      features: {
        analytics: true, // Optional - defaults to your Cloud configuration
      }
    })
    
    function ContextProvider({ children, cookies }: { children: ReactNode; cookies: string | null }) {
      const initialState = cookieToInitialState(wagmiAdapter.wagmiConfig as Config, cookies)
    
      return (
        <WagmiProvider config={wagmiAdapter.wagmiConfig as Config} initialState={initialState}>
          <QueryClientProvider client={queryClient}>{children}</QueryClientProvider>
        </WagmiProvider>
      )
    }
    
    export default ContextProvider