Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.privacyboost.io/llms.txt

Use this file to discover all available pages before exploring further.

Configuration

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

Required Parameters

ParameterTypeDescription
serverUrlstringURL of the Privacy Boost server
appIdstringYour application identifier (see App Setup)

Optional Parameters

ParameterTypeDescription
chainIdnumberEVM chain ID for the target network (auto-discovered from server)
shieldContractAddressstringAddress of the deployed Shield contract (auto-discovered from server)
wethContractAddressstringWETH 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 '@sunnyside-io/privacy-boost';

const sdk = await PrivacyBoost.create({
  serverUrl: 'https://test-api.privacyboost.io',
  wethContractAddress: '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
SERVER_URLPrivacy Boost server URL
SHIELD_CONTRACT_ADDRESSShield contract address (auto-discovered if omitted)
WETH_CONTRACT_ADDRESSWETH contract address
RPC_URLJSON-RPC URL
export PRIVACY_BOOST_APP_ID=app_abc123xyz
export SERVER_URL=https://test-api.privacyboost.io

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({
  serverUrl: 'https://test-api.privacyboost.io',
  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.forChain(). Only serverUrl is required — all other parameters are auto-discovered:
const ethereum = sdk.forChain({ serverUrl: 'https://eth.example.com' });
const base = sdk.forChain({
  serverUrl: 'https://base.example.com',
  chainId: 8453,
  wethContractAddress: '0x4200000000000000000000000000000000000006',
});
ParameterTypeRequiredDescription
serverUrlstringYesURL of this chain’s server
chainIdnumberNoEVM chain ID (auto-discovered)
shieldContractAddressstringNoShield contract address (auto-discovered)
wethContractAddressstringNoWETH 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