Skip to Content
Getting StartedQuickstart

Quickstart

Create an app, connect the host wallet, and read from storage.

app.ts
import { createApp } from "@parity/product-sdk"; const app = await createApp({ name: "my-app", logLevel: "info", }); // Connect to host-provided accounts. const { accounts } = await app.wallet.connect(); console.log("Connected accounts:", accounts); // Persist a value. Namespaced under the app name in host storage. await app.localStorage.set("lastVisit", new Date().toISOString()); const lastVisit = await app.localStorage.get("lastVisit"); console.log("Last visit:", lastVisit);

createApp must run inside a compatible host (Polkadot Desktop, Polkadot Mobile, a web host like dot.li , or @parity/host-api-test-sdk for local development). Outside a host it throws Host storage unavailable.

Last updated on