Skip to main content

Configuration

Once you have an App ID, initialize the SDK with a configuration object specifying your endpoints and target chain.

Required Parameters

ParameterTypeDescription
indexerUrlstringURL of the Privacy Boost indexer service
appIdstringYour application identifier (see App Setup)

Optional Parameters

ParameterTypeDescription
chainIdnumberEVM chain ID for the target network (auto-discovered from indexer)
shieldContractstringAddress of the deployed Shield contract (auto-discovered from indexer)
wethContractstringWETH contract address (required for native ETH deposits)
rpcUrlstringJSON-RPC URL for on-chain reads (token registry lookups)
logLevelstringConsole 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

NetworkChain IDDescription
OP Sepolia11155420Optimism Sepolia testnet (recommended for development)

CLI Environment Variables

The CLI reads configuration from environment variables:
VariableDescription
PRIVACY_BOOST_APP_ID or APP_IDApplication identifier
PRIVACY_BOOST_INDEXER_URLIndexer service URL
WETH_CONTRACTWETH contract address
RPC_URLJSON-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:
LevelOutput
"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',
});
ParameterTypeRequiredDescription
indexerUrlstringYesURL of this chain’s indexer/server
chainIdnumberNoEVM chain ID (auto-discovered)
shieldContractstringNoShield contract address (auto-discovered)
wethContractstringNoWETH contract address
rpcUrlstringNoRPC URL for on-chain reads
tokenRegistryAddressstringNoToken registry contract (auto-discovered)
teePublicKeystringNoTEE 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