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.
Nothing renders in FirstflowWidget
Work through this checklist in order:Check experience status
In the Dashboard, verify the experience status is active. Draft experiences are never returned by the SDK.
Verify config is loading
Open browser DevTools → Network. Filter for
config. You should see a GET /agents/your-agent-id/config request returning 200.If it returns 401: your API key is wrong or expired.
If it returns 404: the agent ID doesn’t exist.Check trigger conditions
chat_opens fires once per session. If you refreshed after it already fired, it won’t fire again until the session resets. Open a new incognito window to test.after_user_message requires the user to send a message. custom_event requires calling firstflow.analytics.track("your-event-name").Check frequency limits
If set to Then reload the page.
once, the SDK records the show in localStorage and won’t show again. Clear frequency records to reset:Check audience targeting
If the experience is not set to Everyone, verify:
- You’re passing a
userprop toFirstflowProvider - The user’s traits match the configured segment or rules
- For segment-based audience, the user’s segment membership is being returned in the config response
Config fetch errors
401 Unauthorized
Your API key is invalid, expired, or doesn’t belong to the specified agent’s organization.
- Check the API key in Dashboard → Agent → Settings → API Keys
- Verify
agentIdmatches the agent the key was created for - Rotate the key and update your environment variable
404 Not Found
The agent ID doesn’t exist or the agent was deleted.
Provider shows fallback indefinitely
The config fetch likely failed silently. Add an onError handler to surface the error:
useFirstflow must be used within FirstflowProvider
The component calling useFirstflow() is not a descendant of FirstflowProvider.
Common causes:
- The provider is inside a route that doesn’t wrap the component using the hook
- Multiple React instances in the bundle (common with monorepos or CDN-loaded React)
FirstflowProvider must be an ancestor of every component that calls useFirstflow() or uses FirstflowWidget.
Experiences appear but look wrong
CSS conflicts The SDK injects its own scoped CSS. If your app’s global styles override* or common class names, they may bleed in. Scope your overrides or use the CSS custom properties:
Survey questions don’t appear
- Confirm the experience type is Survey (not Tour or Announcement)
- Confirm questions are configured in the flow editor (add message nodes with survey question types)
- If using node trigger conditions, verify the conditions are met for the user
Analytics events missing from Dashboard
Events are batched and processed with a 1–2 minute delay. If events are still missing:- Check the Network tab for
trackrequests toapi.firstflow.app - Verify the provider has loaded config before
analytics.track()is called - Check for CORS errors — your domain must be allowed in the Dashboard settings
custom_event trigger fires when the event name exactly matches the configured value. Event names are case-sensitive.
Performance
Config fetch adds latency to app startup Use the Next.js SDK withgetFirstflowConfig() to prefetch server-side. For React apps, the config is cached in memory — subsequent mounts within 5 minutes are instant.
Large bundle size
The SDK tree-shakes. Only import components you use:
React Native
Metro can’t resolve@firstflow/react-native
AsyncStorage is not installed or not linked. Install it and run pod install for iOS: