Configuration
Once you have an App ID, initialize the SDK with a configuration object specifying your endpoints and target chain.
Required Parameters
| Parameter | Type | Description |
|---|
indexerUrl | string | URL of the Privacy Boost indexer service |
appId | string | Your application identifier (see App Setup) |
Optional Parameters
| Parameter | Type | Description |
|---|
chainId | number | EVM chain ID for the target network (auto-discovered from indexer) |
shieldContract | string | Address of the deployed Shield contract (auto-discovered from indexer) |
wethContract | string | WETH contract address (required for native ETH deposits) |
rpcUrl | string | JSON-RPC URL for on-chain reads (token registry lookups) |
logLevel | string | Console log verbosity: "silent" (default), "error", "warn", "info", "debug" |
Example
import { PrivacyBoost } from '@testinprod-io/privacy-boost';
const sdk = await PrivacyBoost.create({
indexerUrl: 'https://test-api.privacy-boost.sunnyside.io/indexer',
wethContract: '0x4200000000000000000000000000000000000006',
appId: 'app_abc123xyz',
});
Supported Networks
| Network | Chain ID | Description |
|---|
| OP Sepolia | 11155420 | Optimism Sepolia testnet (recommended for development) |
CLI Environment Variables
The CLI reads configuration from environment variables:
| Variable | Description |
|---|
PRIVACY_BOOST_APP_ID or APP_ID | Application identifier |
PRIVACY_BOOST_INDEXER_URL | Indexer service URL |
WETH_CONTRACT | WETH contract address |
RPC_URL | JSON-RPC URL |
export PRIVACY_BOOST_APP_ID=app_abc123xyz
export PRIVACY_BOOST_INDEXER_URL=https://test-api.privacy-boost.sunnyside.io/indexer
privacy-boost login
Logging
By default, the SDK produces no console output (silent). Set logLevel to control verbosity during development or debugging:
| Level | Output |
|---|
"silent" | No output (default) |
"error" | Errors only |
"warn" | Errors and warnings |
"info" | Errors, warnings, and informational messages |
"debug" | All messages including verbose debug output |
const sdk = await PrivacyBoost.create({
indexerUrl: 'https://test-api.privacy-boost.sunnyside.io/indexer',
appId: 'app_abc123xyz',
logLevel: 'debug', // Enable verbose logging for development
});
Use "debug" during development to trace SDK operations. In production, leave it as "silent" (the default) or "error" to avoid leaking internal state to the browser console.
All log messages are tagged with the originating module (e.g., [Vault], [Auth]) for easy filtering in browser dev tools.
Multi-Chain Configuration
To operate on additional chains beyond your primary one, create chain clients with sdk.chain(). Only indexerUrl is required — all other parameters are auto-discovered:
const arbitrum = sdk.chain({ indexerUrl: 'https://arb.example.com' });
const base = sdk.chain({
indexerUrl: 'https://base.example.com',
chainId: 8453,
wethContract: '0x4200000000000000000000000000000000000006',
});
| Parameter | Type | Required | Description |
|---|
indexerUrl | string | Yes | URL of this chain’s indexer/server |
chainId | number | No | EVM chain ID (auto-discovered) |
shieldContract | string | No | Shield contract address (auto-discovered) |
wethContract | string | No | WETH contract address |
rpcUrl | string | No | RPC URL for on-chain reads |
tokenRegistryAddress | string | No | Token registry contract (auto-discovered) |
teePublicKey | string | No | TEE public key (auto-discovered) |
See Multi-Chain for the full guide.
Next Steps
Authentication
Connect a wallet and log in
Key Management
Key derivation, persistence, and recovery
Multi-Chain
Operate across multiple blockchains