Bootstrap Config
Hydrate the entire billing and wallet modal experience for an end-user in one single network round-trip.
Instead of triggering 4 or 5 separate calls (balance, pricing, history, themes), use this single fast method to bootstrap your custom billing interfaces instantly.
typescript
const dashboardData = await settle.billing.bootstrap('user_998877')
// 1. Read current active wallet balance
console.log(dashboardData.walletState.currentBalance) // 450
// 2. Retrieve custom UI customizations from SettleSettle config
console.log(dashboardData.uiConfig.themeColor) // "#10B981"
console.log(dashboardData.uiConfig.title) // "Credit Wallet"
// 3. Loop through active monetized event rules
console.log(dashboardData.billingRules)
// [{ eventType: 'AI_PROMPT', creditsCost: 5 }]
// 4. Deliver local ledger transactions
console.log(dashboardData.walletState.history)Building Your Customizable User Wallet
With the bootstrap payload, you can effortlessly construct a native user wallet dashboard tailored to your branding:
- Showcase Available Balance: Extract
walletState.currentBalanceand wrap it inside an immersive banner styled with your centralizeduiConfig.themeColor. - Expose Deductions & Grants: Map through the
walletState.historypayload to show users precisely how their credits are being consumed (e.g., "-5 Credits for AI Prompt") and awarded. - Embed Quick Refills: Render a prominent "Get More Credits" button at the head of your UI that instantly initialises standard Checkout modals when their ledger drops low.
Response Schema Overview
This method delivers a combined object payload mapping to your active Dashboard settings:
uiConfig**: Custom branding configurations containingthemeColor,logoUrl,title, and custom visual CSS injectors.walletState**: Complete financial payload housingcurrentBalanceand detailed itemized transactionhistoryrecords for usage visibility.billingRules**: All active pricing configurations (i.e., how many credits are consumed per tracked usage event).availablePackages**: Array of custom active Credit Packages configured directly inside your SettleSettle Dashboard (e.g.{ name: 'Starter Pack', credits: 1000, priceKobo: 500000 }), allowing you to render a dynamic refill grid instantly.
