Documentation Index
Fetch the complete documentation index at: https://docs.firstflow.app/llms.txt
Use this file to discover all available pages before exploring further.
FirstflowProvider. Mount it once, above any component that renders FirstflowWidget or calls Firstflow hooks. Do not nest providers.
Usage
Props
Your agent ID from the Dashboard. Identifies which agent’s experiences to load.
Your public API key from the Dashboard. Used to authenticate SDK requests.
Current user context. Required for any experience that uses audience targeting, segments, or decision conditions that reference Pass
traits.*.null to clear the user (e.g., after logout). You can also update the user at any time by calling firstflow.setUser().Pre-fetched SDK config from
getFirstflowConfig() (Next.js only). When provided, the client hydrates immediately without a network request. See the Next.js quickstart.Rendered while the initial config is loading. Defaults to rendering children immediately (no fallback). Use this if you need to block rendering until config is available.
Called if the config fetch fails. The SDK silently no-ops if this prop is not provided — experiences simply don’t render.
Called when a flow node triggers a user message prompt — for example, when a button CTA has a configured prompt value. Use this to inject the prompt text into your chat input.Example:
Notes
- Config is cached in memory for 5 minutes per
agentId+apiKeypair - Multiple providers with the same credentials share the cache
- Call
firstflow.refreshConfig()to bypass the cache and force a fresh fetch