A React application demonstrating integration between Flow blockchain and Magic SDK for seamless user authentication and transaction signing.
This example shows how to:
- Authenticate users using Magic's email login
- Connect to Flow testnet
- Sign and submit Cadence transactions using Magic's Flow extension
- Verify transactions on the Flow blockchain
- Magic Authentication: Email-based login using Magic's authentication service
- Flow Integration: Connected to Flow testnet for blockchain interactions
- Transaction Verification: Submit and verify Cadence transactions
- Modern UI: Clean React interface with real-time transaction status
- Node.js (v14 or higher)
- pnpm (or npm/yarn)
- Magic account with Flow extension enabled
-
Clone this repository
-
Install dependencies:
pnpm install
-
Start the development server:
pnpm start
-
Open http://localhost:3000 in your browser
- Login: Enter your email address and click "Send" to receive a magic link
- Verify: Click the magic link in your email to authenticate
- View Address: Your Flow testnet address will be displayed
- Test Transaction: Click "Verify" to submit a simple Cadence transaction
The app is pre-configured for Flow testnet:
- Access Node:
https://rest-testnet.onflow.org
- Network: testnet
- Magic Key: Uses a demo public key (replace with your own for production)
The verification transaction is a simple Cadence script that:
- Prepares an account reference
- Logs the account address to verify the connection works
- Uses modern Cadence syntax (
&Account
instead of deprecatedAuthAccount
)
@magic-ext/flow
: Magic SDK Flow blockchain extension@onflow/fcl
: Flow Client Library for blockchain interactionsmagic-sdk
: Core Magic SDK for authenticationreact
: Frontend framework
- This example uses Flow testnet for safe testing
- The Magic public key included is for demonstration only
- For production use, replace with your own Magic keys and consider mainnet configuration
- AuthAccount Error: This has been fixed - the app now uses modern
&Account
syntax - Transaction Fails: Ensure you're connected to testnet and have a valid account
- Login Issues: Check that Magic emails aren't in spam folder