Skip to main content

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.

Installation

npm install @firstflow/nextjs
Requirements: Next.js 14+, App Router

Exports

@firstflow/nextjs re-exports everything from @firstflow/react and adds Next.js-specific utilities.

From @firstflow/nextjs

ExportDescription
FirstflowProviderSame as @firstflow/react. Accepts initialSdkPayload for SSR hydration.
FirstflowWidgetSame as @firstflow/react.
SurveySame as @firstflow/react.
useFirstflow()Same as @firstflow/react.
useFirstflowSurvey()Same as @firstflow/react.

From @firstflow/nextjs/server

ExportDescription
getFirstflowConfig()Server-side config prefetch for use in Server Components.

Component boundaries

Server Component (app/layout.tsx)
├── getFirstflowConfig()         ✓ server utility
└── <FirstflowProvider>          ✓ renders from server

Client Component ("use client")
├── useFirstflow()               ✓
├── useFirstflowSurvey()         ✓
├── <FirstflowWidget>            ✓
└── <Survey>                     ✓
FirstflowProvider, FirstflowWidget, and all hooks are Client Components. They cannot be called directly from React Server Components. getFirstflowConfig() is the only server-side export.

React reference pages

All shared components and hooks are documented in the React reference:

FirstflowProvider

FirstflowWidget

useFirstflow()

Survey

useFirstflowSurvey()