Login / Register

Connect to Blocto wallet through Flow Client Library (FCL)

Step 1 - Configure FCL

import * as fcl from "@onflow/fcl"
fcl.config()
// connect to Flow testnet
.put("accessNode.api", "https://access-testnet.onflow.org")
// use Blocto testnet wallet
.put("challenge.handshake", "https://flow-wallet-testnet.blocto.app/authn")

Step 2 - Authenticate

import * as fcl from "@onflow/fcl"
fcl
.currentUser()
.subscribe(console.log) // fires everytime account connection status updates
// authenticate
fcl.authenticate()

Step 3 - Unauthenticate

import * as fcl from "@onflow/fcl"
fcl
.currentUser()
.subscribe(console.log) // fires everytime account connection status updates
// unauthenticate and clear account info in FCL
fcl.unauthenticate()