Skip to main content

SmartAccountConfig

Pass a config object to the SmartAccountKit constructor:
import { SmartAccountKit, IndexedDBStorage } from 'smart-account-kit';

const kit = new SmartAccountKit({
  rpcUrl: 'https://soroban-testnet.stellar.org',
  networkPassphrase: 'Test SDF Network ; September 2015',
  accountWasmHash: 'YOUR_WASM_HASH',
  webauthnVerifierAddress: 'YOUR_VERIFIER_ADDRESS',
});

Options

rpcUrl
string
required
Stellar RPC endpoint URL. Use https://soroban-testnet.stellar.org for testnet or https://mainnet.stellar.validationcloud.io/v1/<key> for mainnet.
networkPassphrase
string
required
Network passphrase. Use the Networks enum from @stellar/stellar-sdk:
  • Testnet: 'Test SDF Network ; September 2015'
  • Mainnet: 'Public Global Stellar Network ; September 2015'
accountWasmHash
string
required
WASM hash of the uploaded smart account contract. Used to deploy new wallet instances. The testnet default is in demo/.env.example.
webauthnVerifierAddress
string
required
Contract address of the deployed WebAuthn verifier. This is the on-chain verifier used to validate passkey signatures.
storage
StorageAdapter
Credential storage backend. Defaults to IndexedDBStorage if not provided.
import { IndexedDBStorage, LocalStorageAdapter, MemoryStorage } from 'smart-account-kit';

storage: new IndexedDBStorage()     // Recommended for web
storage: new LocalStorageAdapter()  // Simple fallback
storage: new MemoryStorage()        // Testing only
timeoutInSeconds
number
default:"30"
Transaction timeout in seconds. Transactions that are not included in a ledger within this window will expire.
rpId
string
WebAuthn Relying Party ID. Defaults to the current hostname (window.location.hostname). Override this if your domain differs from the RP ID registered during passkey creation.
rpName
string
WebAuthn Relying Party display name. Shown to the user during passkey creation.
relayerUrl
string
URL of a relayer proxy for fee-sponsored transactions. When set, the SDK routes all submissions through the relayer instead of the RPC endpoint.
relayerUrl: 'https://my-relayer.example.com'
See the Fee Sponsoring guide for details.
indexerUrl
string
Override the default indexer URL. The SDK auto-selects a default indexer based on networkPassphrase. Only set this if you’re running a custom indexer.

Environment Variables (Demo / Vite)

If you’re using Vite, the recommended pattern is to read from environment variables:
const kit = new SmartAccountKit({
  rpcUrl: import.meta.env.VITE_RPC_URL,
  networkPassphrase: import.meta.env.VITE_NETWORK_PASSPHRASE,
  accountWasmHash: import.meta.env.VITE_ACCOUNT_WASM_HASH,
  webauthnVerifierAddress: import.meta.env.VITE_WEBAUTHN_VERIFIER_ADDRESS,
  relayerUrl: import.meta.env.VITE_RELAYER_URL,
});
.env
VITE_RPC_URL=https://soroban-testnet.stellar.org
VITE_NETWORK_PASSPHRASE=Test SDF Network ; September 2015
VITE_ACCOUNT_WASM_HASH=<wasm_hash>
VITE_WEBAUTHN_VERIFIER_ADDRESS=<verifier_contract_id>
VITE_RELAYER_URL=https://my-relayer.example.com

Testnet Defaults

The demo .env.example ships with pre-deployed testnet contract addresses so you can get started without deploying your own contracts.
VariableDescription
VITE_ACCOUNT_WASM_HASHSmart account WASM hash (testnet)
VITE_WEBAUTHN_VERIFIER_ADDRESSWebAuthn verifier contract (testnet)
VITE_ED25519_VERIFIER_ADDRESSEd25519 verifier contract (testnet)
VITE_THRESHOLD_POLICY_ADDRESSThreshold multisig policy (testnet)
VITE_SPENDING_LIMIT_POLICY_ADDRESSSpending limit policy (testnet)
VITE_NATIVE_TOKEN_CONTRACTNative XLM SAC contract (testnet)