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.
useFirstflow() returns the Firstflow platform instance. Must be called inside a component that is a descendant of FirstflowProvider.
Usage
Instance
setUser(user)
Update the current user identity and traits. Call this after login, after a plan upgrade, or any time user traits change that affect experience targeting.
reset()
Clears the current user, segment memberships, frequency records, and cached config. Call after logout to ensure the next user starts fresh.
refreshConfig()
Force a re-fetch of agent config from the API, bypassing the 5-minute cache.
analytics.track(event, properties?)
Track a custom event. Custom events can trigger experiences configured with the custom_event trigger type in the Dashboard.
Event name. Must match the event name configured on the experience trigger.
Optional event properties. Stored alongside the event for analytics.
analytics.identify(userId, traits)
Identify the current user with traits. An alternative to passing user to FirstflowProvider — useful when user data is available asynchronously.
survey.submit(options)
Submit survey answers programmatically, outside the normal widget flow.
The ID of the survey experience to submit answers for.
Map of question ID to answer value.