Learn how to combine the Para Modal with Solana wallets.
This guide will walk you through the process of integrating Solana 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 Phantom, Backpack and more.
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 thisReact + Viteguide.
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 Solana wallets includingPhantom, Glow, Backpack, and Solflare.
1
Install dependencies
Install the required packages alongside your existing Para dependencies:
Configure the ParaSolanaProvider component by wrapping your application content in the QueryClientProvider and ParaSolanaProvider components. Pass in the required configuration props:
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.
A custom provider component can be created to encapsulate the ParaSolanaProvider and ParaModal, allowing for easier
management of the modal state and wallet connections. An example implementation is shown below:
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:
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
Using dynamic imports:
In Next.js, use the dynamic function to import the provider component with { ssr: false }.
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.Optionally, you can pass the createLinkedEmbeddedForExternalWallets prop to include full Para authentication for specific wallets.
This will add a signature verification step for these wallets and will setup a full Para account for the user, including creating Para wallets according to your APi key settings.
Defines the authentication layout style for social login and external wallets. Options are AUTH_FULL, EXTERNAL_FULL, AUTH_CONDENSED, and EXTERNAL_CONDENSED. Test the layout options in our Modal Designer
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:
Since connection only wallets bypass Para, most Para functionality will be unavailable. This includes full Para auth with external wallets, on & off ramping, etc.
Now that you have integrated Solana wallets into your Para Modal, you can explore more advanced features like signing
using the Para SDK with popular libraries like Solana Web3.js.