Skip to main content

Integrate Push Universal Wallet

Overview

Push Universal Wallet gives your app:

  • Seamless cross-chain wallet integration (EVM, Solana, etc.)
  • Provider/consumer hook API for global state
  • Built-in UI components for connect buttons and modals
  • Eliminates the need to manage complex blockchain connections, authentication states, and cross-chain interactions manually

How It Works

The Push Universal Wallet operates on a simple provider-consumer pattern:

  1. Provider Setup: Wrap your application with PushUniversalWalletProvider to initialize wallet functionality
  2. Button Integration: Add PushUniversalAccountButton components where users should connect
  3. State Management: Use the usePushWalletContext hook to access wallet state and methods throughout your app

The Push Universal Wallet provides a unified interface for connecting to multiple blockchains, automatically handling authentication and cross-chain interactions without complex blockchain-specific implementations.

Installation

npm install @pushchain/ui-kit
Note

If you are using Vite with Plug'n'Play (PnP) or encounter a buffer error, simply install buffer as a dependency.

The UI-kit already includes the necessary polyfills, so no extra configuration is required.

Quickstart

REACT PLAYGROUND
// Import necessary components from @pushchain/ui-kit
import {
  PushUniversalWalletProvider,
  PushUniversalAccountButton,
  PushUI,
} from '@pushchain/ui-kit';

function App() {
  // Define Wallet Config
  const walletConfig = {
    network: PushUI.CONSTANTS.PUSH_NETWORK.TESTNET,
  };

  return (
    <PushUniversalWalletProvider config={walletConfig}>
      <PushUniversalAccountButton />
    </PushUniversalWalletProvider>
  );
}
LIVE APP PREVIEW

Customization Parameters

Customize the parameters as per your need and the wallet functionality being used.

PushUniversalWalletProvider

Below is a list of minimum parameters required to customize the Push Universal Wallet Provider. Check out PushUniversalWalletProvider for more information on how to use and customize the Push Universal Wallet Provider.

TheseArgumentsare mandatory

ArgumentsTypeDefaultDescription
configPushUniversalWalletProviderConfig-Core configuration object for wallet connections.
config.networkPushUI.CONSTANTS.PUSH_NETWORK.TESTNET-Push Chain network to conenct to. For example: PushUI.CONSTANTS.PUSH_NETWORK.TESTNET
PushUI.CONSTANTS.PUSH_NETWORK
PushUI.CONSTANTS.PUSH_NETWORK.TESTNET PushUI.CONSTANTS.PUSH_NETWORK.TESTNET_DONUT PushUI.CONSTANTS.PUSH_NETWORK.LOCALNET
config.app{ title, description, logoUrl }(Optional) app metadata for login/preview in the modal.
config.login{ email, google, wallet, appPreview }Toggle login methods.
config.modal{ loginLayout, connectedLayout, appPreview }Customize the modal layout.
themeMode'light' | 'dark'lightForce a particular theme.
themeOverridesRecord<string,string> & { light, dark }Override CSS vars globally or per theme.


PushUniversalAccountButton

Check out PushUniversalAccountButton for more information on how to use and customize the Push Universal Account Button.

Next Steps