Skip to main content

Overview

The repository includes three example applications in the examples/ directory:
  1. Web Example — Svelte + Vite, with three wallet connection methods (Cartridge, Privy, private key) and panels for every SDK module.
  2. Mobile Example — React Native + Expo, mirroring the web example across eight feature tabs.
  3. Server Example — Express backend providing Privy wallet operations and a paymaster proxy for the other two.
The web and mobile examples cover the same ground and consume the SDK straight from the repo (file:../.. and file:../../packages/native), so a change to src/ is picked up on the next build.
The web example is a Svelte + Vite app demonstrating wallet integration in the browser. Its panels are organised by SDK module, one directory per feature under examples/web/src/features/.

Features

  • ✅ Three wallet connection methods:
    • Cartridge Controller (social login / passkey)
    • Privy (server-managed keys)
    • Private Key (local signing)
  • ✅ Account deployment and status checking, across account presets (OpenZeppelin, Argent, Braavos, and others)
  • ✅ Balances, transfers, staking, and yield
  • ✅ Swaps and DCA (AVNU and Ekubo)
  • ✅ Lending (Vesu)
  • ✅ Bridging from Ethereum and Solana, and withdrawals out of Starknet
  • ✅ Privacy — both the STRK20 pool and Tongo

Getting Started

The app will be available at http://localhost:5173 (or the port Vite assigns). npm install also builds the SDK from the repo root, since the example depends on it as starkzap: file:../...

Running with Privy Server

Privy and the paymaster proxy both come from the server example. Run both at once from examples/web:
Or start them separately — Vite on 5173, Express on 3001:
Then point the app at the server with VITE_PRIVY_SERVER_URL in examples/web/.env.

Bridge Setup (Web Example)

The web example can also demonstrate bridge flows from Ethereum/Solana into Starknet, as well as withdrawals out of Starknet.Set optional environment variables in examples/web/.env:
Layerswap keys are environment-scoped. The web example also reads VITE_LAYERSWAP_API_KEY_MAINNET / VITE_LAYERSWAP_API_KEY_TESTNET (falling back to VITE_LAYERSWAP_API_KEY), plus an optional VITE_LAYERSWAP_BASE_URL override.
SDK setup in examples/web/src/main.ts:

Key Code Snippets

Connecting with Cartridge:
Connecting with Privy:
Executing a Transaction:

Common Patterns

Error Handling

All examples include proper error handling:

Loading States

Examples demonstrate loading state management:

Transaction Tracking

All examples show how to track transaction status:

Next Steps

  • Explore the example code in the examples/ directory
  • Adapt the patterns to your own application
  • Check the API Reference for detailed method documentation
  • Review the Troubleshooting guide if you encounter issues