DocumentationConfiguration
DocsSDK reference

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.

Network configuration
TargetChainAccess
sepolia11155111Sepolia; operator testnet access required.
mainnet1Ethereum Mainnet; real ETH.
localnet11155111Self-hosted operator; supply matching deployment assets.
Select Sepolia
.env
VITE_ZKAPI_NETWORK=sepolia

Choose 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.

Generate Sepolia assets
JavaScript
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.

entry.ts
TypeScript
import { configurePurse, DEPLOYMENTS } from "@openzk.app/purse";

configurePurse(DEPLOYMENTS.sepolia);

// app.tsx imports the React hooks after configuration.
await import("./app");
DeploymentInfo fields
FieldPurpose
networkmainnet, sepolia, or localnet.
serverUrlYour operator’s public base URL.
chainIdThe chain where the vault is deployed.
vaultAddressThe deployment’s Ethereum vault address.
testnetPasswordRequiredWhether 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.
Troubleshooting

Resolve missing assets, network mismatches, and protocol errors.

Documentation for the OpenZK browser toolkit. Report a documentation issue ↗