Example Projects

This page provides an overview of the example projects available in the use-wallet repository. Each example demonstrates key features and best practices for integrating use-wallet into different frameworks and environments.

All examples are built with Vite or their respective meta-frameworks and include:

  • Complete wallet integration with all supported providers

  • Transaction signing demonstration

  • End-to-end tests with Playwright

  • TypeScript configuration

  • Runtime node configuration UI (Vite examples only)

Framework Examples

Vite (React)

git clone https://github.com/TxnLab/use-wallet
cd use-wallet/examples/react-ts
pnpm install
pnpm dev

The React example demonstrates:

  • React-specific hooks and patterns

  • Component composition with TypeScript

  • Integration with React's state management

  • Advanced features like runtime node configuration

Vite (Vue)

The Vue example showcases:

  • Vue composables and plugins

  • Integration with Vue's reactivity system

  • TypeScript support in Vue components

  • Advanced features like runtime node configuration

Vite (SolidJS)

The Solid example illustrates:

  • Solid.js primitives and patterns

  • Fine-grained reactivity integration

  • TypeScript configuration for Solid

  • Advanced features like runtime node configuration

Vite (Svelte)

The Svelte example showcases:

  • Svelte primitives and patterns

  • Integration with Svelte's reactivity system

  • TypeScript support in Svelte components

  • Advanced features like runtime node configuration

Vite (Vanilla TypeScript)

The Vanilla TypeScript example demonstrates:

  • Framework-agnostic usage

  • Direct WalletManager implementation

  • Custom state management

  • TypeScript configuration without a framework

Meta-Framework Examples

Next.js

The Next.js example demonstrates:

  • Server-side rendering considerations

  • Next.js-specific configuration

  • Integration with Next.js App Router

  • TypeScript configuration for Next.js

Nuxt

The Nuxt example showcases:

  • Server-side rendering with Vue

  • Nuxt module integration

  • Auto-imports configuration

  • TypeScript configuration for Nuxt

Key Features

Wallet Integration

All examples include a complete wallet connection interface demonstrating:

  • Connecting/disconnecting wallets

  • Switching active accounts

  • Transaction signing

  • Network management

Runtime Node Configuration

The Vite examples include a UI for configuring Algorand node settings at runtime:

  • Custom node URL/port/headers

  • Network switching

  • Configuration persistence

For more information about this feature, see the Runtime Node Configuration guide.

Testing

All examples include end-to-end tests using Playwright, demonstrating:

  • Mocked Algorand node responses

  • Wallet connection testing

  • Transaction signing tests

  • Network switching tests

For more information about testing, see the Testing with Mnemonic Wallet guide.

Getting Started

  1. Clone the repository:

  1. Install dependencies:

  1. Build the packages:

  1. Run an example using the provided scripts:

Next Steps

Last updated