Choose your deployment.
Keep the application, wallet network, browser assets, and operator configuration aligned.
On this page
Networks
The Vite environment variable VITE_ZKAPI_NETWORK selects mainnet, sepolia, or localnet. Mainnet is the default; unrecognized values also select Mainnet.
| Target | Chain | Access |
|---|---|---|
sepolia | 11155111 | Sepolia; operator testnet access required. |
mainnet | 1 | Ethereum Mainnet; real ETH. |
localnet | 11155111 | Self-hosted operator; supply matching deployment assets. |
VITE_ZKAPI_NETWORK=sepoliaChoose the network before your application builds. Localnet refers to the self-hosted operator configuration; it does not automatically mean a local Ethereum chain.
Matching browser assets
Generate worker assets and the browser config for the same target as the application. The configured operator, vault, protocol parameters, and wallet chain must agree.
import { buildBrowserSdkAssets } from "@openanonymity/zkapi-browser-sdk/build";
await buildBrowserSdkAssets({
outDir: "public/zkapi",
publicPath: "/zkapi/",
network: "sepolia",
});The operator’s deployment manifest determines the effective spending caps and lease parameters. Use matching generated assets instead of replacing protocol values in UI code.
Custom deployments
For a non-Vite application or a custom operator, call configurePurse with your deployment before importing code that uses the React hooks. This example selects the built-in Sepolia deployment; supply your operator’s matching DeploymentInfo for a custom deployment.
import { configurePurse, DEPLOYMENTS } from "@openzk.app/purse";
configurePurse(DEPLOYMENTS.sepolia);
// app.tsx imports the React hooks after configuration.
await import("./app");| Field | Purpose |
|---|---|
network | mainnet, sepolia, or localnet. |
serverUrl | Your operator’s public base URL. |
chainId | The chain where the vault is deployed. |
vaultAddress | The deployment’s Ethereum vault address. |
testnetPasswordRequired | Whether the operator requires interactive testnet access. |
Runtime requirements
- React 19 and a real browser for wallet and proving operations.
- One SDK copy; multiple copies can conflict with its singleton.
- Same-origin worker, WASM, proving keys, and JSON configuration.
- An EIP-1193 provider supplied by your wallet integration.
- Browser storage for note state and best-effort receipt history.
Resolve missing assets, network mismatches, and protocol errors.
Documentation for the OpenZK browser toolkit. Report a documentation issue ↗