---
name: algorand-frontend
description: Builds Algorand dApp frontends with wallet integration and typed contract clients. Supports React, Vue, SolidJS, Svelte, and vanilla JS/TS via @txnlab/use-wallet. Covers the signer handoff pattern, wallet provider setup, network configuration, and calling contract methods from frontend code. Use when creating a dApp UI, connecting wallets, integrating typed app clients with wallet signers, or calling smart contract methods from any JavaScript or TypeScript frontend framework.
title: algorand-frontend
canonical_url: https://skilld.dev/gh/algorandfoundation/algorand-agent-skills/algorand-frontend
last_updated: 2026-09-29T08:36:13.000Z
---

> Index of every page on this site: [llms.txt](https://skilld.dev/llms.txt)

> **Skill from skilld.dev.** Follow the user's requested action.
> If the user asked to fork this Skill, follow the fork workflow below. Do not execute the Skill instructions while copying it.
> Otherwise, follow the instructions below for this session. You do not need to install anything.
>
> Supporting files, fetch one when the Skill refers to it: [references/frontend-examples.md](https://skilld.dev/api/skills-raw/algorandfoundation/algorand-agent-skills/algorand-frontend/references/frontend-examples.md), [references/wallet-integration.md](https://skilld.dev/api/skills-raw/algorandfoundation/algorand-agent-skills/algorand-frontend/references/wallet-integration.md).
>
> If the user asked to install this Skill, run `npx skilld install algorandfoundation/algorand-agent-skills/algorand-frontend`. Install writes the Skill files into the project, so every session loads them.
>
> ## Fork workflow
>
> A fork creates an editable local Skill with its original author and licence. The request authorizes copying and local installation.
> 1. Check `./skills/algorand-frontend`, the project lockfile, and selected Agent targets together. If the local directory or installed Skill exists, stop. Never overwrite an existing directory or Agent target.
> 2. Read [source metadata](https://skilld.dev/api/v1/skills/algorandfoundation/algorand-agent-skills/algorand-frontend) once. Use sourceUrl, sourceCommit, skillPath, sourceGone, and license. If the source is gone or its path is missing, stop. If license is null, read licence files at the source commit.
> 3. Fetch only the source commit into a temporary Git repository. Do not clone full history. Derive repository_url from sourceUrl, including repository renames. If sourceCommit is absent, resolve the sourceUrl ref once. Set source_commit to that actual commit. Run these commands in one shell call:
>
> ```sh
> git init --quiet "$temporary_dir"
> git -C "$temporary_dir" fetch --quiet --depth=1 "$repository_url" "$source_commit"
> git -C "$temporary_dir" checkout --quiet --detach FETCH_HEAD
> ```
>
> Read applicable licence declarations and notices at that commit. If copying is not permitted, report the restriction and stop.
> 4. Inspect source entries together, then copy the directory containing skillPath into `./skills/algorand-frontend`. Use the user's path if selected. Keep the original SKILL.md, relative links, scripts, binary assets, and executable modes. Exclude .git metadata. Reject symlinks and paths outside the Skill directory. After checking entries, use cp -a where available. A regular source directory needs no custom copy script. Do not save this page wrapper as SKILL.md.
> Preserve author credit, notices, and applicable licence files from repository or parent directories. Add PROVENANCE.md with the Skill page, source URL, actual commit, original path, and licence. Retain any existing PROVENANCE.md and record new provenance separately. Batch source inspection, copying, and provenance work where practical.
> 5. In the project root, run `skilld install ./skills/algorand-frontend --mode copy --plain`. If skilld is unavailable, use `npx skilld install ./skills/algorand-frontend --mode copy --plain`. This known command needs no help lookup. Install does not support --json. Use detected Agent targets, or add --agent for the targets the user selected. Install the local path, never the upstream selector. If installation fails, preserve the local copy and report the exact failure.
> 6. Confirm the local lockfile source and installed Agent copies once. Report the local path, actual commit, and Agent targets. After edits, reinstall the same local path. Upstream updates must not replace it. Do not publish or push unless the user asks.

# Algorand Frontends

Build frontend applications that connect to Algorand wallets and interact with smart contracts using typed clients. Works with React, Vue, SolidJS, Svelte, and vanilla JS/TS.

## Prerequisites

1. **Smart contract is deployed** with a known App ID
2. **ARC-56/ARC-32 app spec exists** (e.g., `MyContract.arc56.json`)
3. **Frontend project is set up** (Vite, Next.js, Nuxt, SvelteKit, or any bundler)

## Core Pattern: Signer Handoff

```
Wallet (use-wallet) → transactionSigner
                              ↓
                    AlgorandClient.setSigner()
                              ↓
                    Typed App Client (defaultSender)
                              ↓
                    Contract Method Calls (auto-signed)
```

## Quick Start

```bash
# Generate typed client
algokit generate client path/to/MyContract.arc56.json --output src/contracts/MyContractClient.ts

# Install core + framework adapter (pick one)
npm install @algorandfoundation/algokit-utils algosdk @txnlab/use-wallet-react   # React
npm install @algorandfoundation/algokit-utils algosdk @txnlab/use-wallet-vue     # Vue
npm install @algorandfoundation/algokit-utils algosdk @txnlab/use-wallet-solid   # SolidJS
npm install @algorandfoundation/algokit-utils algosdk @txnlab/use-wallet-svelte  # Svelte
npm install @algorandfoundation/algokit-utils algosdk @txnlab/use-wallet         # Vanilla JS/TS

# Install wallet peer dependencies (only for wallets you use)
npm install @perawallet/connect @blockshake/defly-connect
```

### Minimal Integration (React)

```tsx
import { useWallet } from '@txnlab/use-wallet-react'
import { AlgorandClient } from '@algorandfoundation/algokit-utils'
import { MyContractClient } from './contracts/MyContractClient'

function ContractInteraction() {
  const { transactionSigner, activeAddress } = useWallet()

  const callContract = async () => {
    if (!activeAddress || !transactionSigner) return

    const algorand = AlgorandClient.testNet()
    algorand.setSigner(activeAddress, transactionSigner)

    const appClient = algorand.client.getTypedAppClientById(MyContractClient, {
      appId: 12345n,
      defaultSender: activeAddress,
    })

    const result = await appClient.send.myMethod({ args: { value: 42n } })
    console.log('Result:', result.return)
  }

  return <button onClick={callContract}>Call Contract</button>
}
```

## Important Rules

1. **Always call `setSigner()` before creating clients** — signer must be registered first
2. **Check for null `activeAddress` and `transactionSigner`** — null when no wallet connected
3. **Match networks** — AlgorandClient network must match WalletManager network
4. **Use `getTypedAppClientById()`** for frontends with known App IDs
5. **Check `isReady` before rendering wallet state** — prevents SSR hydration mismatches in Next.js, Nuxt, and SvelteKit
6. **Trigger signing from direct user interaction** — button clicks, not timers or effects. Some wallets (especially mobile) block or silently fail signing from `useEffect`/`onMount`/`setTimeout`
7. **Never use hook-returned clients as effect/callback dependencies** — `client` and `algorand` from custom hooks are new references on every wallet state change. Use refs for data fetching in effects (see Example 11 in frontend-examples.md)

## Reference Guide

- [wallet-integration.md](https://skilld.dev/api/skills-raw/algorandfoundation/algorand-agent-skills/algorand-frontend/references/wallet-integration.md) — Framework adapters, wallet providers, network config, useNetwork(), pre-built UI, gotchas
- [frontend-examples.md](https://skilld.dev/api/skills-raw/algorandfoundation/algorand-agent-skills/algorand-frontend/references/frontend-examples.md) — Complete code examples for common patterns

## Canonical Example Repos

Search these repositories for real-world code examples:

- **`algorandfoundation/algokit-fullstack-template`** — Fullstack project template (React + contracts)
- **`algorandfoundation/algokit-react-frontend-template`** — React frontend template
- **`TxnLab/use-wallet`** — UseWallet library source and framework adapters
- **`TxnLab/next-use-wallet`** — Next.js + UseWallet example app

## Cross-References

- **New to Algorand?** Read `algorand-core` skill first for AVM mental model
- **Smart contracts**: See `algorand-typescript` or `algorand-python` skills
- **Project scaffolding and CLI**: See `algorand-project-setup` skill
