{"id":51283413,"url":"https://github.com/onflow/flow-react-sdk-starter","last_synced_at":"2026-06-30T03:30:34.875Z","repository":{"id":353234891,"uuid":"1078258080","full_name":"onflow/flow-react-sdk-starter","owner":"onflow","description":"Next.js starter template for building Flow dApps with @onflow/react-sdk. AI-native React SDK that LLMs reliably generate code for","archived":false,"fork":false,"pushed_at":"2026-04-24T17:00:42.000Z","size":161,"stargazers_count":4,"open_issues_count":0,"forks_count":1,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-06-03T23:41:47.116Z","etag":null,"topics":["ai-native-development","dapp","fcl","flow","flow-react-sdk","flow-sdk","frontend","nextjs","react","starter-template","typescript","web3"],"latest_commit_sha":null,"homepage":"https://flow.com","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/onflow.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-10-17T12:58:40.000Z","updated_at":"2026-04-26T14:22:46.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/onflow/flow-react-sdk-starter","commit_stats":null,"previous_names":["onflow/flow-react-sdk-starter"],"tags_count":0,"template":true,"template_full_name":null,"purl":"pkg:github/onflow/flow-react-sdk-starter","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/onflow%2Fflow-react-sdk-starter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/onflow%2Fflow-react-sdk-starter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/onflow%2Fflow-react-sdk-starter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/onflow%2Fflow-react-sdk-starter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/onflow","download_url":"https://codeload.github.com/onflow/flow-react-sdk-starter/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/onflow%2Fflow-react-sdk-starter/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34951598,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-30T02:00:05.919Z","response_time":92,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ai-native-development","dapp","fcl","flow","flow-react-sdk","flow-sdk","frontend","nextjs","react","starter-template","typescript","web3"],"created_at":"2026-06-30T03:30:34.309Z","updated_at":"2026-06-30T03:30:34.860Z","avatar_url":"https://github.com/onflow.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# flow-react-sdk-starter — Next.js Starter for Flow React SDK\n\nA minimal Next.js starter template for building Flow applications using `@onflow/react-sdk`. This starter includes interactive tutorials and examples to help you get started quickly.\n\n## Features\n\n- **Next.js** with App Router and Turbopack\n- **Flow React SDK** `@onflow/react-sdk` pre-configured\n- **FlowProvider** wrapper with Testnet configuration\n- **Interactive tutorials** with working examples:\n  - Wallet connection with official Connect component\n  - Testnet faucet integration\n  - Balance checking with `useFlowQuery`\n  - Token transfers with `useFlowMutate`\n- **Network indicator** showing current Flow network (Testnet/Mainnet/Emulator)\n- **Responsive design** optimized for mobile, tablet, and desktop\n\n## Getting Started\n\n### Installation\n\n```bash\nnpm install\n# or\nyarn install\n# or\npnpm install\n```\n\n### Development\n\n```bash\nnpm run dev\n# or\nyarn dev\n# or\npnpm dev\n```\n\nOpen [http://localhost:3000](http://localhost:3000) with your browser.\n\n### Build\n\n```bash\nnpm run build\n```\n\n## Project Structure\n\n```\nsrc/\n├── app/\n│   ├── layout.tsx                  # Root layout with FlowProvider\n│   ├── page.tsx                    # Main landing page (Server Component)\n│   └── globals.css                 # Global styles\n└── components/\n    ├── flow-provider-wrapper.tsx   # FlowProvider configuration\n    ├── flow-header.tsx             # Header with Connect component \u0026 network indicator\n    ├── flow-content.tsx            # Main content component (Client Component)\n    └── tutorial/\n        ├── wallet-connect.tsx      # Step 1: Wallet connection tutorial\n        ├── faucet-funding.tsx      # Step 2: Testnet faucet integration\n        ├── flow-balance.tsx        # Step 3: Balance query example (useFlowQuery)\n        └── send-flow.tsx           # Step 4: Token transfer example (useFlowMutate)\n```\n\n## FlowProvider Configuration\n\nThe `FlowProvider` is configured in `src/components/flow-provider-wrapper.tsx` with **Flow Testnet** by default.\n\nTo switch networks, update the config:\n\n**Mainnet:**\n\n```typescript\naccessNodeUrl: \"https://rest-mainnet.onflow.org\",\ndiscoveryWallet: \"https://fcl-discovery.onflow.org/mainnet/authn\",\nflowNetwork: \"mainnet\",\n```\n\n**Emulator:**\n\n```typescript\naccessNodeUrl: \"http://localhost:8888\",\ndiscoveryWallet: \"http://localhost:8701/fcl/authn\",\ndiscoveryAuthnEndpoint: \"http://localhost:8701/fcl/authn\",\nflowNetwork: \"emulator\",\n```\n\n## Running on Flow Emulator\n\nThe Flow Emulator allows you to run a local Flow network for development and testing. The Connect button works seamlessly with the emulator's dev wallet.\n\n### Prerequisites\n\nInstall the Flow CLI ([full installation guide](https://developers.flow.com/build/tools/flow-cli/install)):\n\n```bash\n# macOS (Homebrew - recommended)\nbrew install flow-cli\n\n# macOS/Linux (pre-built binary)\nsudo sh -ci \"$(curl -fsSL https://raw.githubusercontent.com/onflow/flow-cli/master/install.sh)\"\n\n# Windows (PowerShell)\niex \"\u0026 { $(irm 'https://raw.githubusercontent.com/onflow/flow-cli/master/install.ps1') }\"\n```\n\nVerify installation:\n\n```bash\nflow version\n```\n\n### Project Setup for Emulator\n\nThis project has been initialized with `flow init`, which created the necessary Cadence development environment:\n\n```bash\ncadence/\n├── contracts/\n│   └── Counter.cdc              # Example smart contract\n├── scripts/\n│   └── GetCounter.cdc           # Script to read contract state\n├── transactions/\n│   └── IncrementCounter.cdc     # Transaction to modify state\n└── tests/\n    └── Counter_test.cdc         # Contract tests\n\nflow.json                        # Flow configuration file\nemulator-account.pkey            # Emulator account private key\n```\n\n### Starting the Emulator\n\n**IMPORTANT**: You must start BOTH the Flow Emulator AND the Dev Wallet before trying to connect your wallet in the application.\n\n1. **Start the Flow Emulator (Terminal 1):**\n\n   ```bash\n   flow emulator start\n   ```\n\n   This starts the Flow Emulator on `http://localhost:8888`. Keep this terminal window open.\n\n2. **Start the Dev Wallet (Terminal 2):**\n\n   Open a **new terminal** and run:\n\n   ```bash\n   flow dev-wallet\n   ```\n\n   This starts the Dev Wallet on `http://localhost:8701`. Keep this terminal window open as well.\n\n3. **Configure FlowProvider for Emulator**\n\n   The `src/components/flow-provider-wrapper.tsx` is already configured for the emulator with the `flowJson` prop:\n\n   ```typescript\n   import flowJSON from \"../../flow.json\";\n\n   export function FlowProviderWrapper({ children }: FlowProviderWrapperProps) {\n     return (\n       \u003cFlowProvider\n         config={{\n           // Emulator configuration\n           accessNodeUrl: \"http://localhost:8888\",\n           discoveryWallet: \"http://localhost:8701/fcl/authn\",\n           flowNetwork: \"emulator\",\n\n           // App metadata\n           appDetailTitle: \"Flow React SDK Starter\",\n           appDetailUrl:\n             typeof window !== \"undefined\" ? window.location.origin : \"\",\n           appDetailIcon: \"https://avatars.githubusercontent.com/u/62387156?v=4\",\n           appDetailDescription:\n             \"A Next.js starter template for Flow applications\",\n\n           // Optional configuration\n           computeLimit: 1000,\n         }}\n         flowJson={flowJSON}\n       \u003e\n         {children}\n       \u003c/FlowProvider\u003e\n     );\n   }\n   ```\n\n   The `flowJson` prop automatically loads contract addresses and account configuration from `flow.json`, making it easier to work with deployed contracts on the emulator.\n\n4. **Start the NextJS Development Server (Terminal 3):**\n\n   Open another terminal and run:\n\n   ```bash\n   npm run dev\n   ```\n\n5. **Connect with Dev Wallet:**\n\n   Click the \"Connect Wallet\" button - it will open the Flow Dev Wallet UI at `http://localhost:8701`. The dev wallet comes with pre-funded test accounts ready to use.\n\n## Tutorial Examples\n\nThe starter includes interactive tutorial components that demonstrate core Flow SDK features:\n\n### 1. Wallet Connection\n\n```typescript\nimport { Connect } from \"@onflow/react-sdk\";\n\n// Official Connect component with wallet discovery\n\u003cConnect /\u003e\n```\n\nGet [Flow Wallet](https://wallet.flow.com) to get started.\n\n### 2. Query Balance (useFlowQuery)\n\n```typescript\nimport { useFlowCurrentUser, useFlowQuery } from \"@onflow/react-sdk\";\n\nconst { user } = useFlowCurrentUser();\nconst { data: balance, isLoading, error, refetch } = useFlowQuery({\n  cadence: FLOW_BALANCE_SCRIPT,\n  args: (arg, t) =\u003e [arg(user?.addr || \"\", t.Address)],\n});\n```\n\nThe `useFlowQuery` hook executes Cadence scripts to read blockchain data.\n\n### 3. Send Transaction (useFlowMutate)\n\n```typescript\nimport { useFlowMutate } from \"@onflow/react-sdk\";\n\nconst { mutate, isPending, isSuccess, error } = useFlowMutate();\n\nconst handleSend = () =\u003e {\n  const formattedAmount = parseFloat(amount).toFixed(8);\n  mutate({\n    cadence: TRANSFER_FLOW_TRANSACTION,\n    args: (arg, t) =\u003e [arg(formattedAmount, t.UFix64), arg(recipient, t.Address)],\n  });\n};\n```\n\nThe `useFlowMutate` hook executes Cadence transactions that modify blockchain state.\n\n## Resources\n\n- [Flow Wallet](https://wallet.flow.com) - Official Flow wallet\n- [Flow Testnet Faucet](https://faucet.flow.com/fund-account) - Get free testnet tokens\n- [Flow React SDK Documentation](https://react.flow.com) - Complete SDK reference\n- [Flow Developer Portal](https://developers.flow.com) - Developer resources\n- [Cadence Documentation](https://cadence-lang.org) - Smart contract language\n- [FCL GitHub](https://github.com/onflow/fcl-js) - Flow Client Library\n- [FlowScan](https://testnet.flowscan.io) - Testnet block explorer\n\n## About Flow\n\nThis repo is part of the [Flow network](https://flow.com), a Layer 1 blockchain built for consumer applications, AI agents, and DeFi at scale.\n\n- Developer docs: https://developers.flow.com\n- Cadence language: https://cadence-lang.org\n- Community: [Flow Discord](https://discord.gg/flow) · [Flow Forum](https://forum.flow.com)\n- Governance: [Flow Improvement Proposals](https://github.com/onflow/flips)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fonflow%2Fflow-react-sdk-starter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fonflow%2Fflow-react-sdk-starter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fonflow%2Fflow-react-sdk-starter/lists"}