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.
Install
Add environment variables
When using
getFirstflowConfig() for SSR prefetch, the server reads FIRSTFLOW_AGENT_ID and FIRSTFLOW_API_KEY without a NEXT_PUBLIC_ prefix. If you skip SSR prefetch and fetch client-side, expose them as NEXT_PUBLIC_FIRSTFLOW_AGENT_ID and NEXT_PUBLIC_FIRSTFLOW_API_KEY instead.Add the provider with SSR prefetch
CallgetFirstflowConfig() in your root layout (a Server Component) and pass the result as initialSdkPayload. This eliminates the client-side loading flash.
Add the widget
FirstflowWidget and all hooks are Client Components. Add "use client" to the component that uses them.
Pass user identity
User traits are runtime data — set them from a Client Component. Option A: Passuser in the layout if you can read session data server-side:
setUser() from a Client Component after login:
Next steps
getFirstflowConfig
Server-side config prefetch API
Next.js reference
All exports from @firstflow/nextjs
FirstflowProvider
All provider props (shared with React)
useFirstflow()
Instance methods (shared with React)