Configuration Reference
Configuration objects for the HyperAuth SDK client and Vault worker.
Configuration Reference
Configuration objects for the HyperAuth SDK client and Vault worker.
ClientConfig
Passed to createClient(config) or HyperAuthClient.create(plugin, config). All fields are optional.
interface ClientConfig {
wasmUrl?: string;
wasmBytes?: Uint8Array;
logger?: Pick<Console, 'log' | 'error' | 'warn' | 'info' | 'debug'>;
debug?: boolean;
autoLockTimeout?: number;
contracts?: ContractsConfig;
}Fields
| Field | Type | Default | Description |
|---|---|---|---|
wasmUrl | string | "/enclave.wasm" | URL from which the WASM enclave binary is fetched. Used by createClient() when initializing the core worker. |
wasmBytes | Uint8Array | — | Raw WASM bytes. Alternative to wasmUrl for environments where fetching is unavailable. |
logger | Pick<Console, 'log' | 'error' | 'warn' | 'info' | 'debug'> | console | Logger instance. All log calls are gated by debug. |
debug | boolean | false | Enable debug logging. When false, no messages are emitted through the logger. |
autoLockTimeout | number | 300000 | Milliseconds of inactivity before the vault is automatically locked. Set to 0 to disable auto-lock. The timer resets on any vault operation. |
contracts | ContractsConfig | Base Sepolia defaults | On-chain contract addresses. Defaults to defaultContracts (Base Sepolia, chain ID 84532). |
Notes
wasmUrlandwasmBytesare mutually exclusive.wasmBytestakes precedence in the bridge implementation if both are supplied.autoLockTimeouttriggersHyperAuthClient.lock()after the inactivity period. If anonAutoLockcallback has been registered viasetAutoLockCallback(), it receives the encrypteddatabasebytes from the lock result.createClient()useswasmUrlandcontractsto initialize the core worker bridge.HyperAuthClient.create()with a pre-constructedWasmPlugindoes not use these fields.
ContractsConfig
Smart contract addresses for a specific EVM chain. Used by the enclave to construct and verify on-chain operations.
interface ContractsConfig {
chainId: number;
entryPoint: string;
didRegistry: string;
accountHelper: string;
sessionSBT: string;
hyperAuthFactory: string;
}Fields
| Field | Type | Description |
|---|---|---|
chainId | number | EVM chain ID |
entryPoint | string | ERC-4337 EntryPoint contract address |
didRegistry | string | HyperAuth DID Registry contract address |
accountHelper | string | Account state helper contract address. Exposes getAccountState(address) and used by /api/accounts/state. |
sessionSBT | string | Session Soulbound Token contract address |
hyperAuthFactory | string | Smart account factory contract address. Exposes getAddress(pubKeyX, pubKeyY, salt) and used by /api/accounts/predict. |
Default values (defaultContracts)
Exported as defaultContracts from @hyperauth/sdk. Matches the DEFAULT_CONTRACTS constant in the Vault worker.
| Field | Value |
|---|---|
chainId | 84532 |
entryPoint | 0x0000000071727De22E5E9d8BAf0edAc6f37da032 |
didRegistry | 0xd38972ffea26b66f09e2109e650887acd447e7b7 |
accountHelper | 0xd4d57cc363dd419cd95712eb5cddf1797ceb9dde |
sessionSBT | 0x5a2822bd69aa3799232ac57decf2b07e3fed1881 |
hyperAuthFactory | 0xb797f4799d8aa218e9207f918fdea3afc76b1e18 |
WorkerConfig
Configuration passed to createCoreBridge(). Used internally by createClient().
interface WorkerConfig {
wasmUrl: string;
debug?: boolean;
contracts?: ContractsConfig;
}Fields
| Field | Type | Default | Description |
|---|---|---|---|
wasmUrl | string | — | URL to fetch the WASM enclave binary. Required. |
debug | boolean | false | Enable debug logging in the core worker. |
contracts | ContractsConfig | — | Contract addresses forwarded to the enclave. |
VaultStoreConfig
Configuration for VaultStore initialization. VaultStore manages the wa-sqlite persistence layer for fast page-reload restore.
interface VaultStoreConfig {
dbName?: string;
}Fields
| Field | Type | Default | Description |
|---|---|---|---|
dbName | string | "hyperauth-vault" | Name of the wa-sqlite database opened in the browser's Origin Private File System. |
VaultSnapshotConfig
Configuration for VaultSnapshot, which wraps vault bytes in DAG-CBOR and stores them in a Helia blockstore.
interface VaultSnapshotConfig {
gatewayUrl?: string;
}Fields
| Field | Type | Default | Description |
|---|---|---|---|
gatewayUrl | string | — | IPFS gateway URL used as a read fallback when the local Helia blockstore does not contain a requested CID. Example: "https://trustless-gateway.link". |
Vault Worker Environment (Env)
The Cloudflare Worker Env interface declares all bindings and secrets required by the Vault worker. These are not SDK configuration — they are Cloudflare Worker environment bindings configured in wrangler.toml and the Cloudflare dashboard.
Bindings
| Binding | Type | Description |
|---|---|---|
VAULT | DurableObjectNamespace<Vault> | Per-identifier Durable Object namespace |
CDN_ASSETS | R2Bucket | R2 bucket for CDN assets (WASM binary) |
ASSETS | Fetcher | Static asset binding for the SPA and payment pages |
SESSION_DB | D1Database | Global D1 database for sessions, registered DIDs, and verified identifiers |
ANALYTICS_ENGINE | AnalyticsEngineDataset | Workers Analytics Engine for event tracking |
INDEXER | Fetcher | Service binding to the indexer worker (optional) |
Environment Variables
| Variable | Type | Description |
|---|---|---|
INDEXER_URL | string | Base URL for the indexer (fallback when INDEXER service binding is absent) |
WIDGET_ALLOWED_ORIGINS | string (optional) | Comma-separated list of origins permitted for CORS on widget-facing endpoints (/api/status, /api/dids/lookup, /api/aliases/check) |
Secrets
| Secret | Description |
|---|---|
TWILIO_ACCOUNT_SID | Twilio account SID for SMS verification |
TWILIO_AUTH_TOKEN | Twilio auth token |
TWILIO_VERIFY_SERVICE_SID | Twilio Verify service SID |
RESEND_API_KEY | Resend API key for email delivery |
RESEND_FROM_EMAIL | Sender address for verification emails (defaults to "onboarding@resend.dev" if absent) |
PIMLICO_API_KEY | API key for the Pimlico ERC-4337 bundler |
ATTESTATION_SIGNING_KEY | HMAC-SHA256 key used to sign and verify VerificationAttestation payloads |
INNGEST_EVENT_KEY | Inngest event key for publishing events |
INNGEST_SIGNING_KEY | Inngest signing key for webhook verification |
Vault Worker Constants
Constants defined in apps/vault/src/lib/types.ts. These values are fixed at deploy time and are not overridable via environment variables.
| Constant | Value | Description |
|---|---|---|
CHAIN_ID | "84532" | Target chain ID (Base Sepolia) |
MAX_REGISTRATIONS_PER_IP | 3 | Maximum registration sessions per IP address |
MAX_VERIFY_ATTEMPTS | 5 | Maximum OTP submission attempts per email code before the code is invalidated |
EMAIL_CODE_EXPIRY_SECONDS | 90 | Email OTP TTL in seconds |
RATE_LIMIT_CODES_PER_IDENTIFIER | 5 | Maximum verification code sends per identifier per hour (email channel only) |
MAX_VERIFY_SENDS_PER_IP | 3 | Maximum verification sends per IP per 24 hours (all channels) |
ATTESTATION_TTL_SECONDS | 300 | Verification attestation validity window in seconds |
WebAuthn Defaults
Constants defined in sdk/client/src/constants.ts.
| Constant | Value | Description |
|---|---|---|
DEFAULT_RP_ID | "did.run" | Default WebAuthn Relying Party ID used by createPasskey() and authenticatePasskey(). Overridable via CreatePasskeyOptions.rpId. |