Tezos LogoTezos Boilerplate

Tezos Wallet Boilerplate Docs

Configuration

Configure your Tezos dApp with the right network settings and providers.

Network Configuration

The boilerplate automatically configures networks based on your environment. The wallet store handles RPC endpoint selection.

Mainnethttps://rpc.tzkt.io/mainnet
Ghostnet (Testnet)https://rpc.tzkt.io/ghostnet

Automatic Network Configuration

// lib/tezos/store/walletStore.ts
import { ENV } from '../../constants';

export const useWalletStore = create<WalletState>((set, get) => ({
  Tezos: new TezosToolkit(
    ENV === 'dev' 
      ? 'https://rpc.tzkt.io/ghostnet' 
      : 'https://rpc.tzkt.io/mainnet'
  ),
  // ... rest of store
}));

// lib/constants.ts 
export const NETWORK = process.env.NEXT_PUBLIC_NETWORK || 'ghostnet';
export const ENV: 'dev' | 'prod' = NETWORK === 'ghostnet' ? 'dev' : 'prod';

Wallet Store Configuration

The new wallet store automatically handles multi-wallet initialization and state management.

Wallet Store Architecture

// lib/tezos/store/walletStore.ts
interface WalletState {
  Tezos: TezosToolkit;
  wallet: BeaconWallet | null;
  kukai: KukaiEmbed | null;
  address: string | null;
  isInitialized: boolean;
  initializeWallets: () => Promise<void>;
  connectWallet: () => Promise<void>;
  connectKukai: () => Promise<void>;
  disconnectWallet: () => Promise<void>;
}

export const useWalletStore = create<WalletState>((set, get) => ({
  // Auto-initialization on app start
  initializeWallets: async () => {
    // Check for existing Beacon connections
    const activeAccount = await wallet.client.getActiveAccount();
    if (activeAccount) {
      set({ address: activeAccount.address });
    }
    
    // Check for existing Kukai sessions  
    const userInfo = kukai.user;
    if (userInfo?.pkh) {
      set({ address: userInfo.pkh });
    }
  }
}));

Environment Variables

Configure your environment variables for different deployment environments.

.env.local

# Network Configuration (only variable needed!)
NEXT_PUBLIC_NETWORK=ghostnet
# or 
# NEXT_PUBLIC_NETWORK=mainnet

# Optional: Custom RPC endpoints (uses defaults if not set)
# NEXT_PUBLIC_RPC_MAINNET=https://your-mainnet-rpc.com
# NEXT_PUBLIC_RPC_GHOSTNET=https://your-ghostnet-rpc.com

๐ŸŽฏ Simplified Configuration

The new architecture only requires NEXT_PUBLIC_NETWORK to be set. All other configuration (RPC endpoints, wallet providers, network types) is handled automatically.

Supported Wallets

The Beacon SDK automatically supports all major Tezos wallets:

๐Ÿ”— Temple Wallet

Popular browser extension wallet

๐Ÿ“ฑ Kukai

Web-based wallet with social login

๐Ÿ“Ÿ Ledger

Hardware wallet support

๐Ÿ” AirGap

Mobile wallet with QR code signing

๐Ÿ‘ป Spire

Modern mobile wallet

๐Ÿฆ„ Umami

Desktop wallet application

TzKT API Configuration

Configure TzKT API for blockchain data and indexing services.

Mainnet APIhttps://api.tzkt.io
Ghostnet APIhttps://api.ghostnet.tzkt.io
Oxfordnet APIhttps://api.oxfordnet.tzkt.io

TzKT API Usage

// Fetch account information
const response = await fetch(
  `https://api.ghostnet.tzkt.io/v1/accounts/${address}`
);
const account = await response.json();

// Fetch account operations
const opsResponse = await fetch(
  `https://api.ghostnet.tzkt.io/v1/accounts/${address}/operations`
);
const operations = await opsResponse.json();

Next Steps

๐Ÿงฉ Components

Learn about the available components and their APIs

Explore components โ†’

๐Ÿ’ก Examples

See working examples of common dApp patterns

View examples โ†’