Guides
Build a Browser App
Step-by-step guide to building a browser-based application with Cascade permanent storage and Keplr wallet.
What You Will Build
A Vite + TypeScript single-page application that connects to Keplr wallet, uploads files to Cascade, and retrieves them by action ID.
Prerequisites
- Node.js >= 18
- Keplr browser extension installed
- Testnet
ulumetokens (get from Lumera Faucet)
Project Setup
Configure Vite
The SDK depends on WASM modules and Node.js globals that need polyfilling in the browser:
Chain Configuration
Wallet Connection
Cascade Client
Putting It Together
Run the App
Open http://localhost:5173, connect Keplr, and try uploading a file. The returned action ID is your permanent reference, use it to retrieve the file from anywhere, at any time.
Key Takeaways
- Always use
getKeplrSigner(orgetLeapSigner) from the SDK which wrap the wallet extension's signer with ADR-036signArbitrarysupport that Cascade requires. - The action ID is your permanent reference. Store it in your database, on-chain, or wherever your application tracks state.
- Uploads are two-phase: first an on-chain transaction (fees, metadata), then a file transfer to SN-API. The SDK handles both.
- Downloads are streaming: use
ReadableStreamto handle large files without loading everything into memory at once.