Signing
Use a passkey-backed wallet for messages and transactions.
Signing requires flow.credential and flow.address. An email-only or guest session can be authenticated while both are null; guide that user through passkey setup before offering signing.
Configure a chain
import { createFlow } from "@flow-industries/id";
import { tempoModerato } from "@flow-industries/id/chains";
import { http } from "viem";
const flow = createFlow({
chains: [tempoModerato],
transports: { [tempoModerato.id]: http() },
});Initialize the browser instance once, after installing the session route. Supply the RPC transport appropriate for your chain. If none is configured, the SDK uses viem's default HTTP transport.
Sign or send
const signature = await flow.signMessage({ message: "hello" });signTypedData() accepts EIP-712 domain, types, primary type, and message fields. sendTransaction() accepts a destination, value or calldata, and optional configured chainId. sendCalls() submits a batch of calls and returns { id }. These methods use the same active-account and chain selection.
For contract calls, get a viem wallet client:
const wallet = await flow.walletClient({ chainId: tempoModerato.id });Use that client's supported viem actions with your contract address and ABI. Treat returned signatures as the account's actual P256/WebAuthn or delegated-key format; do not assume an ordinary EOA signature is interchangeable with it.
Passkey and access-key selection
An available, unexpired access key signs locally. Otherwise the wallet falls back to the root passkey and its WebAuthn prompt. With accessKey: { strict: true }, encountering an expired stored access key throws Access key expired. Strict mode does not mean every missing key is an error: no stored key still uses the root passkey.
Handle user cancellation, RPC failures, and insufficient balance in your app. The SDK also rejects missing signing state and an unconfigured chain. A successful login is not evidence that a transaction succeeded.
Fee sponsorship
For a Tempo integration with a configured sponsor service, use withFeePayer from @flow-industries/id/chains around the chain transport and fee-payer transport. Sponsorship is a separate service configuration; enabling the SDK alone does not fund transactions. Wagmi integrations pass their transport map through to the same wallet client.