Hooks
All hooks are imported from @appfunnel-dev/sdk. Use them in any component rendered inside a page file (src/pages/*.tsx) or the funnel wrapper (src/funnel.tsx).
import { useResponse, useNavigation } from '@appfunnel-dev/sdk'Responses
| Hook | Description |
|---|---|
useResponse | Read/write a single response variable (answers.*) |
useResponses | Read all response variables as a flat object |
Data
| Hook | Description |
|---|---|
useData | Read/write a data.* variable |
Query Params
| Hook | Description |
|---|---|
useQueryParam | Read a single URL query parameter |
useQueryParams | Read all URL query parameters |
Navigation
| Hook | Description |
|---|---|
useNavigation | Navigate between pages, read current page, and track progress |
usePageData | Read page-level system variables (index, progress, timestamps) |
User
| Hook | Description |
|---|---|
useUser | Read and update built-in user fields (email, name, DOB) |
useUserProperty | Read/write a custom user property |
useDateOfBirth | Format-aware date of birth input, always stores as ISO |
Products & Payments
| Hook | Description |
|---|---|
useProducts | Access the product catalog and selection state |
usePayment | Read payment and card authorization state |
Tracking
| Hook | Description |
|---|---|
useTracking | Fire custom analytics events and identify users |
Localization
| Hook | Description |
|---|---|
useTranslation | Access translations, switch locale at runtime |
useLocale | Read the browser’s locale, language, timezone |
Device & Context
| Hook | Description |
|---|---|
useDeviceInfo | Read device, browser, and OS metadata |
useSafeArea | CSS safe area insets for notched devices |
useKeyboard | Detect virtual keyboard visibility and height |
Convenience
| Hook | Description |
|---|---|
useFunnel | All major hooks combined into a single object |
Advanced
| Hook | Description |
|---|---|
useVariable | Read/write any variable by full namespaced ID |
useVariables | Read all variables across every namespace |
Last updated on