@onflow/react-sdk
v0.20.0
Published
React library for interacting with the Flow blockchain
Maintainers
Keywords
Readme
@onflow/react-sdk
A React library that provides hooks for interacting with the Flow blockchain. It helps you authenticate users, run Cadence scripts and transactions, listen to events, and manage network configuration directly from your components.
🔧 Installation
npm install @onflow/react-sdk🧩 Quick Setup
Before using any hooks, wrap your app in the FlowProvider:
import { FlowProvider } from "@onflow/react-sdk"
import flowJson from "../flow.json"
<FlowProvider
config={{
accessNodeUrl: "https://rest-mainnet.onflow.org",
flowNetwork: "mainnet",
appDetailTitle: "My On Chain App",
appDetailIcon: "https://example.com/icon.png",
appDetailDescription: "A decentralized app on Flow",
appDetailUrl: "https://myonchainapp.com",
}}
flowJson={flowJson}
>
<App />
</FlowProvider>🪝 Available Hooks
useFlowCurrentUseruseFlowAccountuseFlowBlockuseFlowConfiguseFlowEventsuseFlowQueryuseFlowRevertibleRandomuseFlowMutateuseFlowTransactionuseCrossVmTokenBalanceuseDarkModeuseFlowTransactionStatususeCrossVmTokenBalance
📚 Full Documentation
Looking for full API docs, examples, and usage tips?
