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. This is the recommended approach — the browser environment has full SDK compatibility.
Why browser-first? The Lumera JS SDK works reliably in browser environments. Node.js support has known limitations with WASM module loading. For production applications, use a browser-based frontend that communicates with Cascade directly.
Prerequisites
- Node.js >= 18
- Keplr browser extension installed
- Testnet
ulumetokens (get from Lumera Discord)
Project Setup
Configure Vite
The SDK depends on WASM modules and Node.js globals that need polyfilling in the browser:
Chain Configuration
Wallet Connection
The SDK requires a signer that supports signArbitrary (ADR-036) for authenticating Cascade operations. Keplr's getOfflineSignerAuto returns a signer that supports this. If you use getKeplrSigner from the SDK, it wraps this with the correct interface.
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 — these 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.