onEvent (or offEvent to remove a listener). React apps can use useOnEvent from @dynamic-labs-sdk/react-hooks for a hook with built-in cleanup.
Subscribing
listener is fully typed against the event name: hover over event in your editor to see the payload TypeScript expects.
Authentication state
State-change events fire whenever a top-level field on theDynamicClient changes. They are the primary way to react to login, logout, and JWT refreshes.
Wallet accounts and providers
For per-provider events (account changes, chain switches inside a single provider), see Wallet Provider Events.
MFA
See the MFA overview for how these surface in the broader flow.
Device registration
See Device Registration.
Checkout
These let you build a transaction status UI without polling. See the Fireblocks Flow JavaScript SDK guide.
React patterns
UseuseOnEvent from @dynamic-labs-sdk/react-hooks — it subscribes on mount and cleans up on unmount:
useUser, useGetWalletAccounts, useInitStatus) — they subscribe to the relevant events internally.
One-time listeners
UseonceEvent for a listener that auto-removes after firing once — useful for waiting on initialization or a single MFA completion.
Type safety
The full event surface is declared globally asDynamicEvents, augmented by each module that emits events. onEvent, offEvent, and onceEvent are generic over keyof DynamicEvents, so the listener signature is inferred from the event name — there is no central enum to keep in sync.