TypeScript SDK
@cloak.dev/sdk — browser + Node.js SDK with a high-level CloakSDK class,
wallet-adapter integration, built-in scanner and note storage.
Integrates with @solana/web3.js and @solana/kit.Rust SDK
cloak-sdk — engine-first Rust crate. One transact() entrypoint,
one TransactOptions struct, full protocol pipeline end-to-end.Which one should I use?
Both SDKs speak the same protocol and produce the same 264-byte public inputs. Migrating between them is straightforward once you understand the shared primitives.
Shared runtime defaults
The relay URL points at Cloak’s hosted submission endpoint that the SDK uses to land transactions on-chain. The default is correct for mainnet — only override
relayUrl if you’re targeting a different deployment (e.g. devnet).
Shared concepts
Before you write code, skim the language-agnostic primer:- Core concepts — commitments, Merkle tree, nullifiers, fees, stale-root retries, viewing keys.
- Transaction flows — how deposit/transfer/withdraw/swap actually hit the chain.
- Viewing keys and compliance — the chain-note compliance rail.
TypeScript SDK
Start here for web3.js and Solana Kit integrations:- Quickstart — minimal end-to-end SOL send.
- Code examples — send, swap, payroll, history.
- API reference — full
CloakSDKclass surface.
Rust SDK
Start here for server-side and CLI integrations:- Introduction — install, minimal setup, and scope.
- Quickstart — first direct-path deposit.
- API reference —
TransactOptions,TransactResult,Relay, and related types.