API Reference
Complete API reference for the Privacy Boost React SDK.Generated Documentation
Full API documentation can be generated using TypeDoc:- All hook signatures and return types
- JSDoc comments with usage examples
- Type definitions and interfaces
Provider
PrivacyBoostProvider
Main provider component that initializes the SDK.
Context Hooks
usePrivacyBoost()
Get direct access to the SDK instance.
usePrivacyBoostState()
Get provider initialization state.
useAuth
Authentication hook.useVault
Vault operations hook.useBalances
Reactive balance data hook.useTransactions
Transaction history hook.useChain
Get a chain-scoped client for multi-chain operations.ChainClient exposes the same vault, auth, and transactions resources as the root SDK, scoped to the target chain. Returns null until the provider has finished initializing. The hook memoizes by serverUrl, so changing other fields between renders is ignored — pass a stable config or a new serverUrl to switch chains.
Helper Functions
createWalletAdapter()
Create wallet adapter from window.ethereum.
Types
PrivacyBoostConfig
Transaction
TokenBalance
useBalances() returns FormattedBalance values, which extend TokenBalance with formattedShielded / formattedWallet strings already formatted with the token’s decimals.
OnProgress
Preview Features
The React SDK does not yet expose dedicated hooks for the two preview features (pending external audit). Access them through the underlying SDK viausePrivacyBoost():
- Claimable Transfers — gifts, via
sdk.wasm - Portal Deposits — via
sdk.portal