This guide will walk you through the process of integrating EVM Wallets into your Para Modal and Para-enabled application, allowing you to onboard new users and connect with existing users who may already have external wallets like MetaMask, Coinbase Wallet and more.

Prerequisites

Before integrating wallet connections, ensure you have an existing Para project with the Para Modal set up. If you haven’t set up Para yet, follow one of our Framework Setup guides like this

React + Vite

guide.

Setting up EVM Wallets

Setup is simple - just wrap your app in a provider and pass the appropriate props and configuration options to the provider. Once configured, the Para modal and wallet options will automatically appear in the modal when opened.

Para provides seamless integration with popular EVM wallets including

MetaMask, Rainbow, Coinbase Wallet, WalletConnect, Zerion, Safe, and Rabby.

Safe App Registration: To use Safe as an external wallet, you’ll need to register your application as a Safe App in the Safe App Registry. This is required because Safe apps need to run within Safe’s context to ensure proper security and functionality. The registration process involves providing your app’s details and undergoing a review by the Safe team.

1

Install dependencies

Install the required packages alongside your existing Para dependencies:

npm install @getpara/evm-wallet-connectors@alpha @tanstack/react-query wagmi
2

Import components

Import the wallet connectors and supporting components you need. Adjust the imports based on which wallets you want to support:

main.tsx
import {
  ParaProvider,
  ExternalWallet,
} from "@getpara/react-sdk@alpha";
import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
import { sepolia, celo, mainnet, polygon } from "wagmi/chains";
3

Configure the providers

Configure the ParaProvider component by wrapping your application content in the QueryClientProvider and ParaProvider components. Pass in the required configuration props:

main.tsx
const queryClient = new QueryClient();

export const App = () => {
  return (
    <QueryClientProvider client={queryClient}>
      <ParaProvider
        // ... rest of your provider config
        externalWalletConfig: {
          wallets: [ExternalWallet.Metamask],
          evmConnector: {
            config: {
              chains: [mainnet, polygon, sepolia, celo],
            },
            // wagmiProviderProps={}
          },
          walletConnect: {
            projectId: 'your_walletconnect_project_id',
          },
        }>
        {/* Your app content */}
      </ParaProvider>
    </QueryClientProvider>
  );
};

External Wallet Configuration

externalWalletConfig
object
required

WalletConnect (Reown) Setup: You’ll need a WalletConnect project ID if you’re using their connector. Get one from the

WalletConnect (Reown) Developer Portal

. You can use an empty string for testing, but this isn’t recommended for production.

The ParaProvider extends Wagmi’s provider functionality, giving you access to all Wagmi Hooksin your application. Place the provider near the root of your component tree for optimal performance.

External Wallets with Linked Embedded Wallets

You can also provision linked embedded wallets for external wallets.

In this case, the external wallet would be the Para auth method for the user’s embedded wallet (instead of an email or social login). Embedded wallets would be created according to your API key settings.

To enable this, you can include the createLinkedEmbeddedForExternalWallets prop to indicate which external wallets this setting should be applied to.

Advanced Provider Pattern

Setting up a dedicated provider component that encapsulates all the necessary providers and modal state management is considered a best practice. This pattern makes it easier to manage the modal state globally and handle session management throughout your application.

Server-Side Rendering Considerations

When using Next.js or other SSR frameworks, proper client-side initialization is crucial since web3 functionality relies on browser APIs. There are two main approaches:

  1. Using the 'use client' directive in Next.js 13+:

    • Add the directive at the component level where browser APIs are needed. If using a custom provider, add the directive to the top of the provider file.
    • Ensures the Web3Provider component and its dependencies only run on the client side
  2. Using dynamic imports:

    • In Next.js, use the dynamic function to import the provider component with { ssr: false }.
    • Lazily loads the provider component
    • Automatically handles client-side only code
    • Provides fallback options during loading

Configuring the Para Modal

After setting up your providers you need to configure the ParaModal component to display the external wallets and authentication options to your users. You need to pass in the externalWallets and authLayout configuration options to the ParaModal component to control which of the wallets show in the modal that were specified in the provider configuration.

1

Set the modal props

paraModalConfig={{  
  authLayout: ["AUTH_FULL","EXTERNAL_FULL"]
  theme: {
    mode: "light",
    foregroundColor: "#000000",
    backgroundColor: "#FFFFFF",
    accentColor: "#007AFF"
  }
  logo: yourLogoUrl
  // ... other modal config
}}

Modal prop options for customizing the Para Modal are included below. For advanced customization options, refer to

Customization Guide

.

ParaModalProps
component
required

Connection Only Wallets

Connection only external wallets bypass all Para functionality (account creation, user tracking, etc.) when connecting an external wallet. To enable this, set the following option on your Para instance when instantiating your ParaProvider:

paraClientConfig={{
  apiKey: YOUR_API_KEY,
  env: Environment.BETA,
  opt: {
    externalWalletConnectionOnly: true,
  }
}}

Since connection only wallets bypass Para, most Para functionality will be unavailable. This includes full Para auth with external wallets, on & off ramping, etc.

Examples

For an example of what the Para External Wallets Modal might look like in your application, check out our live demo:

For an example code implementation using EVM Wallets, check out our GitHub repository:

Next Steps

Now that you have integrated EVM wallets into your Para Modal, you can explore more advanced features like signing using the Para SDK with popular libraries like Ethers.js.