PartyLayer
Try Demo

PartyLayerKit

PartyLayerKit is the zero-config wrapper component that sets up everything your dApp needs for wallet connectivity. It creates the SDK client, registers adapters, fetches the wallet registry, and provides theme and session context to all child components.

Basic Usage

tsx
import { PartyLayerKit } from '@partylayer/react';

function App() {
  return (
    <PartyLayerKit network="mainnet" appName="My dApp">
      {/* Your app components */}
    </PartyLayerKit>
  );
}

Props

PropTypeDefaultDescription
network"devnet" | "testnet" | "mainnet"—Canton network to connect to. Determines which wallets and registry entries are available.
appNamestring—Your application name, shown to wallets during connection requests.
localestring"en"Wallet UI language: 14 languages and regional tags; unsupported tags fall back to English.
direction"ltr" | "rtl"AutomaticOverride layout direction. Arabic defaults to RTL; other languages use LTR.
authenticationPartyLayerAuthenticationAdapter—Application backend integration for server-verified sign-in. Omitted means wallet connection only.
showAttributionbooleantrueShow Powered by PartyLayer in the connection modal.
disclaimerReactNode—Optional application terms/privacy content in the modal footer.
childrenReactNode—Your application component tree.
registryUrlstring"https://registry.partylayer.xyz"Override the wallet registry URL. Useful for self-hosted registries.
channel"stable" | "beta""stable"Registry channel. Use "beta" to include wallets in beta testing.
adapters(WalletAdapter | AdapterClass | OfficialProviderAdapter | OfficialAdapterFactory)[]Default wallet catalogCustom wallet adapter list. Overrides the default built-in adapters if provided. Also accepts official provider adapters and adapter factories.
walletConnectWalletConnectAdapterConfig—Your Cloud project id and optional pairing metadata. No separate wallet package needed.
bronBronAdapterConfig—Your Bron OAuth/API configuration. Hidden when omitted.
additionalAdaptersPartyLayerConfig["adapters"]—Extend the default catalog with custom adapters.
theme"light" | "dark" | "auto" | PartyLayerTheme"light"Theme preset or a custom theme object. "auto" follows system preference.
walletIconsRecord<string, string>{}Custom wallet icon URLs keyed by walletId. Overrides registry icons.
walletOrderreadonly string[]—Wallet ids in display order for the connect modal. Unlisted wallets fall to the end; sorting applies within the CIP-0103 Native and Available sections.
sessionOptionsPartial<SessionStoreOptions>—Session-store options forwarded to PartyLayerProvider (reconnect, expiry, broadcast, persistSnapshot, storage, onInvalidate) for explicit persistence, reconnect and multi-tab behavior. The kit uses an in-memory live session view by default.

UI Language and Direction

tsx
<PartyLayerKit network="devnet" appName="My dApp" locale="tr-TR" direction="rtl">
  <ConnectButton />
</PartyLayerKit>

English is the default. Supported languages are English, Turkish, Spanish, French, German, Portuguese, Italian, Russian, Arabic, Hindi, Indonesian, Japanese, Korean and Simplified Chinese. Regional tags share a catalog; unsupported languages and Traditional Chinese scripts fall back to English. Arabic automatically uses RTL; direction overrides that choice. Changing language preserves the client and wallet connection. English and Turkish render synchronously. Other catalogs load on demand; initial server and hydration output uses English, then updates when ready. Browser language is not guessed and the application document is not mutated.

This translates PartyLayer connection, account, cost and transaction UI, including accessible labels. Your application content, custom labels, wallet names, identifiers, provider error details and vendor approval screens retain their own language settings. Advanced provider compositions can use PartyLayerLocaleProvider with the same locale and direction props.

Network Configuration

The network prop determines which Canton network your dApp connects to. Wallets and registry entries are filtered by network.

tsx
// Development
<PartyLayerKit network="devnet" appName="My dApp">

// Staging / testing
<PartyLayerKit network="testnet" appName="My dApp">

// Production
<PartyLayerKit network="mainnet" appName="My dApp">

Custom Adapters

By default, PartyLayerKit supplies the supported wallet catalog for your network and channel. Configure WalletConnect and Bron through application options:

tsx
import { PartyLayerKit, ConnectButton } from '@partylayer/react';

const walletConnect = { projectId: 'your-walletconnect-project-id' };
const bron = {
  auth: {
    clientId: 'your-client-id',
    redirectUri: 'https://your-app.com/auth/callback',
    authorizationUrl: 'https://auth.bron.example/authorize',
    tokenUrl: 'https://auth.bron.example/token',
  },
  api: { baseUrl: 'https://api.bron.example' },
};

<PartyLayerKit network="mainnet" appName="My dApp" walletConnect={walletConnect} bron={bron}>
  <ConnectButton />
</PartyLayerKit>
⚠️ Warning
When you provide the adapters prop, it replaces the default catalog entirely. Use additionalAdapters to extend it while retaining the official SDKs and CIP-0103 discovery.

Custom Wallet Icons

Override wallet icons with the walletIcons prop. Keys are wallet IDs and values are image URLs:

tsx
<PartyLayerKit
  network="mainnet"
  appName="My dApp"
  walletIcons={{
    console: '/images/console-logo.png',
    loop: '/images/loop-logo.svg',
    'my-custom-wallet': '/images/custom-wallet.png',
  }}
>

Icons are resolved with this priority: walletIcons prop (exact match) → walletIcons (fuzzy match) → registry icon URL → fallback.

Theming

Pass a theme preset or a custom PartyLayerTheme object:

tsx
// Preset themes
<PartyLayerKit theme="light" ...>
<PartyLayerKit theme="dark" ...>
<PartyLayerKit theme="auto" ...>  {/* Follows system preference */}

// Custom theme
import { lightTheme } from '@partylayer/react';

const myTheme = {
  ...lightTheme,
  colors: {
    ...lightTheme.colors,
    primary: '#7C3AED',
    primaryHover: '#6D28D9',
  },
};

<PartyLayerKit theme={myTheme} ...>

See Theming for full theme customization details.

How It Works

PartyLayerKit internally:

  • Creates a PartyLayerClient via createPartyLayer()
  • Wraps children in PartyLayerProvider (React context for the SDK client)
  • Wraps in ThemeProvider (theme context for styled components)
  • Wraps in WalletIconsContext (icon override context)
  • Handles client cleanup on unmount via client.destroy()
💡 Tip
The client is re-created when network, appName,registryUrl, channel, additionalAdapters,walletConnect or bron change. Keep configuration objects stable. Configure the replacement adapters catalog at mount; changing that array alone does not rebuild the client. Theme, locale and direction changes preserve the connection.
PreviousIntegration SupportNextConnectButton