privacy protocol logo
Skip to Content
Cloak SDKInstallation

Installation

The SDK ships as @privacy-protocol/cloak. It uses viem  for chain access; the React entry point additionally uses wagmi  and TanStack Query.

Core (any TypeScript / JavaScript project)

npm install @privacy-protocol/cloak viem

React

npm install @privacy-protocol/cloak viem wagmi @tanstack/react-query

The proving stack (@noir-lang/noir_js and @aztec/bb.js) is bundled as a direct dependency — you don’t install it separately, and the versions are pinned for proof compatibility.

Environment notes

  • Browser — proving runs in a WebAssembly worker. No special config is needed with Vite or Next.js; if your bundler is strict about WASM, ensure @aztec/bb.js is allowed to load its worker.
  • Node — works out of the box (Node 20+). Useful for backends and scripts.
  • WalletConnect / SSR — build the client lazily on the browser side; the Merkle sync and proving are client operations.

What you need to configure

Two addresses and one URL, provided for each deployment:

ValueDescription
poolAddressThe deployed CloakPool contract
relayerUrlThe Cloak relayer base URL
deployBlock(Optional) block the pool was deployed at, to speed up event sync

Fetch the current Sepolia values from your Privacy Protocol dashboard, then head to the Quickstart.

Last updated on