Getting Started

Installation

The Althea SDK is distributed as a single npm package. It ships with the ZK circuit WASM, the verification key, and TypeScript definitions. Everything you need is in afrzk-sdk.

Install the package

terminal
npm install afrzk-sdk
# or
pnpm add afrzk-sdk
# or
yarn add afrzk-sdk

Peer dependencies

The SDK does not bundle Solana web3 helpers — you bring your own so version mismatches never bite. Install the wallet adapter packages you actually use; the React adapter is the most common.

peers
npm install \
  @solana/web3.js \
  @solana/wallet-adapter-react \
  @solana/wallet-adapter-react-ui
PackageWhy it's required
@solana/web3.jsBuilding & signing transactions
@solana/wallet-adapter-reactUsed by submitProof() to request a signature from the connected wallet
@solana/wallet-adapter-react-uiOptional - only if you want the standard connect-wallet UI

Runtime requirements

  • Node 20.9 or later for build tooling
  • A modern evergreen browser with WebAssembly support (Chrome 111+, Firefox 111+, Safari 16.4+)
  • A Solana wallet — Phantom, Backpack, Solflare, or any wallet-adapter compatible provider

Bundler notes

The SDK loads afrzk.wasm from the package itself via new URL('./afrzk.wasm', import.meta.url). Most modern bundlers (Turbopack, Vite, Webpack 5) handle this out of the box. For Next.js 16 the default Turbopack pipeline works without any configuration.

Custom Webpack setups

If you eject from Turbopack and use a custom Webpack config, enable async WebAssembly experiments. snarkjs also references some Node builtins from older builds; alias them to an empty module for the browser bundle.
next.config.ts (only if customizing)
import type { NextConfig } from 'next'

const nextConfig: NextConfig = {
  turbopack: {
    resolveAlias: {
      // Allow snarkjs to resolve in the browser without polyfills
      'node:fs': { browser: './lib/empty.ts' },
      'node:path': { browser: './lib/empty.ts' },
    },
  },
  webpack: (config) => {
    config.experiments = { ...config.experiments, asyncWebAssembly: true }
    return config
  },
}

export default nextConfig

Verify the install

With the package installed, the imports below should resolve and autocomplete:

sanity-check.ts
import {
  verifyIdentity,
  generateProof,
  submitProof,
  checkAttestation,
  wipeCredential,
} from 'afrzk-sdk'

Continue with Your First Integration for the end-to-end walkthrough.