FLOWDocs
SDK

Wagmi

Connect Wagmi to the same Flow identity and signing state.

flowConnector() from @flow-industries/id/wagmi adapts the Flow wallet to Wagmi. A wallet connection requires a credential-backed address; an email-only or guest login by itself does not provide one.

Configure the connector

bun add @flow-industries/id wagmi viem ox @tanstack/react-query
import { tempoModerato } from "@flow-industries/id/chains";
import { flowConnector } from "@flow-industries/id/wagmi";
import { createConfig, http } from "wagmi";

export const config = createConfig({
  chains: [tempoModerato],
  connectors: [flowConnector()],
  transports: { [tempoModerato.id]: http() },
});

The app still needs the first-party session handler. Use Wagmi's WagmiProvider and a TanStack Query provider around components that use its hooks.

Connect and reconnect

Use Wagmi's useConnect() with the connector whose ID is flow. When authentication is needed, connecting starts top-level Flow ID navigation. capabilities: { type: "sign-up" } requests account creation. Do not depend on an iframe, popup, headless mode, or a post-login continuation in the document being unloaded.

On reconnect the connector attempts flow.restore() instead of interactive sign-in. If no address is available, it remains disconnected. Guide an authenticated user without a credential through passkey setup before offering wallet operations.

Standard Wagmi signing and transaction hooks use the Flow wallet client. Cancellation, unsupported chains, missing credentials, and RPC errors still need visible handling in your app. Disconnecting the connector calls Flow logout; it is not just a visual wallet disconnect.

Share an instance

When also using React hooks or direct SDK methods, pass your existing browser instance as flowConnector({ flow }). The connector otherwise reuses the singleton or creates one lazily. Configure that explicit instance with the same chains and transports as Wagmi so fee sponsorship and custom RPC behavior agree.

See Signing and Access keys for credential requirements and delegated signing.

On this page