Guidance for AI coding agents (Claude Code, Codex, Cursor, Copilot, and others) working in this repository. Loaded into agent context automatically — keep edits concise.
fcl-js is the TypeScript/JavaScript Flow Client Library monorepo: the reference client
for connecting browser and server apps to the Flow blockchain and FCL-compatible wallets
(README.md). It is a Lerna monorepo with independent package versioning (lerna.json:
"version": "independent") using npm workspaces (package.json:
"workspaces": ["./packages/*"]), with releases driven by Changesets from the master
branch (.changeset/config.json, .github/workflows/release.yml). The flagship package is
@onflow/fcl (packages/fcl/); @onflow/sdk (packages/sdk/) is the lower-level Flow
Access API client FCL is built on.
This repo uses npm + Lerna, not pnpm or yarn. There is no pnpm-workspace.yaml; the
committed lockfile is package-lock.json.
Root scripts (package.json):
npm i— install workspace dependencies (CONTRIBUTING.md).make installrunsnpm ci.npm run build—lerna run buildacross all packages.npm test— runsjestwithprojects: ["<rootDir>/packages/*"](jest.config.js).npm start—npm run build && lerna run start --parallel(per-package watch mode).npm run prettier:check/npm run prettier— check/write formatting.npm run generate-all-docs—node docs-generator/generate-all-docs.js; scans packages that declare agenerate-docsscript and invokes each one.npm run demo— runs emulator + dev-wallet + Vite inpackages/demo(requiresflowCLI).npm run demo:testnet— same demo app pointed at testnet.npm run changeset/npm run release— changeset CLI /build && changeset publish.
Makefile wrappers (Makefile):
make all→clean install build test.make ci→clean install build, thennpm run test -- --ciandnpm run prettier:check. This is exactly what.github/workflows/integrate.ymlruns on every PR.make clean— deletesnode_modules/,dist/,types/inside everypackages/*.make publish— runsnpm publishin every package (not typical; CI uses Changesets).
Per-package scripts are uniform (see packages/fcl/package.json, packages/sdk/package.json,
etc.): test → jest, build → fcl-bundle (often preceded by eslint .), start →
fcl-bundle --watch, build:types → tsc (where present). The bundler is the in-tree
@onflow/fcl-bundle package (packages/fcl-bundle/, wraps Rollup). To work on one package,
cd packages/<name> && npm test (or npm run test:watch where declared).
CI uses Node 18 for PRs (integrate.yml) and Node 22 for releases (release.yml).
No engines field is declared in any package.json.
Everything ships from packages/*. Verified packages (29):
Flagship / entry points
fcl/—@onflow/fcl, the browser-first high-level client (wallet discovery, authn,query,mutate, transactions, signatures).fcl-core/—@onflow/fcl-core, platform-agnostic core thatfclandfcl-react-nativebuild on. Houseswallet-provider-spec/andwallet-utils/.fcl-react-native/—@onflow/fcl-react-native, React Native variant of FCL.sdk/—@onflow/sdk, low-level Flow Access API client (builders, interactions, encode/ decode, resolvers). FCL wraps this.
React kits
react-core/—@onflow/react-core, platform-agnostic React hooks (TanStack Query-based).react-sdk/—@onflow/react-sdk, web React bindings built onreact-core+fcl.react-native-sdk/—@onflow/react-native-sdk, RN bindings built onreact-core+fcl-react-native.
EVM / cross-VM
fcl-ethereum-provider/— EIP-1193 Ethereum provider backed by an FCL wallet.fcl-wagmi-adapter/— Wagmi connector built onfcl-ethereum-provider.fcl-rainbowkit-adapter/— RainbowKit adapter built onfcl-wagmi-adapter.
Wallet connectivity
fcl-wc/—@onflow/fcl-wc, WalletConnect v2 adapter for FCL.
Transports / encoding / types
transport-http/— HTTP transport against the Flow Access API (used bysdk).transport-grpc/— gRPC-Web transport. Ignored by Changesets (.changeset/config.json"ignore": ["@onflow/transport-grpc"]) — do not add changesets for it.protobuf/—@onflow/protobuf, generated gRPC protobuf bindings (built via webpack, notfcl-bundle).rlp/— RLP encoder port (MPL-2.0; every other package is Apache-2.0).types/— Cadence value type codecs (t.Int,t.Address, …).typedefs/—@onflow/typedefs, public TypeScript definitions (see README § TypeScript).
Shared utilities (util-*)
util-actor,util-address,util-encode-key,util-invariant,util-logger,util-rpc,util-semver,util-template,util-uid.
Config + tooling + dev
config/—@onflow/config, FCL's config store (e.g.fcl.config({...})).fcl-bundle/— the internal Rollup-based bundler every publishable package uses.demo/—@onflow/demo(private), Vite app for manual testing against emulator/testnet/ mainnet. Seepackages/demo/README.md.
- Do not switch package managers. The repo is npm + Lerna + Changesets. Switching to pnpm/yarn breaks lockfile and CI.
- Do not add a top-level integration test.
jest.config.jsaggregatespackages/*Jest projects; tests live inside each package next to source (*.test.ts). - Write a changeset for any package-facing change. Run
npx changesetper CONTRIBUTING.md. The baseBranch ismaster, notmain. @onflow/transport-grpcis Changeset-ignored — do not create a changeset entry targeting it (.changeset/config.json).- Never edit
packages/protobuf/src/generated/— regenerate via the package'sgeneratescript (protoc ...). This path is also in.prettierignore. - Versions are independent. Lerna
"version": "independent"; bumping@onflow/fcldoes not bump siblings. Cross-package imports use pinned versions — update them explicitly when changing a shared util's API. - Builds run lint. Most packages define
"build": "npm run lint && fcl-bundle"; a lint error will failnpm run buildand thereforemake ci. @onflow/fcl-bundleis in-tree. When debugging build output, editpackages/fcl-bundle/rather than searching for it innode_modules.- Commit message format (CONTRIBUTING.md):
TOPIC -- [package-name] description. Topics:PKG(package change, needs changelog),DOC,OPS,VSN. - Prettier config:
semi: false,bracketSpacing: false,arrowParens: "avoid"(.prettierrc). CI runsprettier --check .as part ofmake ci. - Wallet provider spec lives in the repo at
packages/fcl-core/src/wallet-provider-spec/(active draft:draft-v4.md). Link here rather than duplicating spec text. @onflow/sdkvs@onflow/fcl: SDK is low-level (Access API only, no wallet). FCL depends on SDK. Don't reimplement SDK primitives insidefclorfcl-core.
packages/protobuf/src/generated/— generated from.proto(also in.prettierignore).package-lock.json— regenerate vianpm i, don't hand-edit.packages/*/CHANGELOG.md— managed by Changesets.packages/*/dist/,packages/*/types/— build output (cleaned bymake clean).