Introduction
React hooks and Vue composables for Polkadot apps
use-truapi packages the entire
@parity/product-sdk surface —
chain queries, accounts, transactions, contracts, chat, statements, payments,
cloud storage — as React hooks
and Vue composables. One
install; the SDK packages stay behind the hooks.
Not using React or Vue?
Use @parity/product-sdk
directly — use-truapi is only the React/Vue binding layer on top of it.
import { useBalance, useTx } from "@use-truapi/react";
function Transfer({ address }: { address: string }) {
const { data: balance } = useBalance(address);
const { submit, phase } = useTx();
// ...
}What you get
- Reads are TanStack Query results, actions are mutations with a named
method (
connect,submit,upload); every hook accepts TanStack options. - Live data — balances, blocks, chat, statements and payments stream through shared subscriptions that detach with the last consumer.
- Host or standalone — embedded in a Polkadot host or in a plain browser tab; chain access, theming and storage adapt automatically.
- Types end to end — register your config once and every hook knows your chain keys and PAPI descriptors.
Packages
| Package | Description |
|---|---|
@use-truapi/react | React hooks (React ≥18) |
@use-truapi/vue | Vue composables (Vue ≥3.4) |
@use-truapi/core | Framework-agnostic runtime the adapters share |