Skip to main content
In this guide you build a Vite and TypeScript single page app that connects to the Keplr wallet, uploads files to Cascade, and retrieves them again by action ID. Cascade is the permanent storage service of Lumera Protocol. You pay once at upload time and the file stays available forever. Every upload returns an action ID. This is the permanent on-chain reference you later use to download the file. The app talks to Cascade straight from the browser. The SDK handles the SN-API transfer, so you do not need a backend server for storage. Browser-first Cascade architecture

What you need

  • Node.js 18 or later
  • The Keplr browser extension
  • Testnet LUME for fees. Request tokens from the faucet.

Build the app

1

Scaffold the project

Create a new Vite project and install the SDK together with the browser build tooling.
2

Configure Vite

The SDK depends on WASM modules and Node.js globals that need polyfilling in the browser.
vite.config.ts
3

Add the chain configuration

This file holds the testnet chain ID, the gas price, and the chain record the app suggests to Keplr.
src/config.ts
4

Connect the Keplr wallet

experimentalSuggestChain registers the Lumera testnet in Keplr the first time a user connects.
src/wallet.ts
5

Create the Cascade client

The getKeplrSigner helper wraps the Keplr signer with the ADR-036 signArbitrary support that Cascade uses to authenticate storage operations. ADR-036 is the Cosmos standard for signing arbitrary off-chain messages.
src/cascade.ts
6

Wire up the UI

The page has three controls. A connect button, an upload button with a file picker, and a download button with an action ID field.
src/main.ts
index.html
7

Run the app

Open http://localhost:5173, connect Keplr, and upload a file. The returned action ID is your permanent reference. Use it to retrieve the file from anywhere, at any time.

Key takeaways

  1. Use getKeplrSigner or getLeapSigner from the SDK. They wrap the wallet extension signer with the ADR-036 signArbitrary support that Cascade requires.
  2. The action ID is your permanent reference. Store it in your database, on chain, or wherever your application tracks state.
  3. Uploads run in two phases. The SDK first registers the action on chain, then transfers the file to a SuperNode.
  4. Downloads are streamed. Read from the ReadableStream so large files never sit fully in memory.

Next steps

Encrypted storage

Encrypt files client-side before uploading them to Cascade.

Research Archive example

Explore a full publishing platform built on Cascade.

Node.js guide

Run the same SDK on a server with a programmatic signer.