Skip to Content
Headless SDKHooksOverview

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

HookDescription
useResponseRead/write a single response variable (answers.*)
useResponsesRead all response variables as a flat object

Data

HookDescription
useDataRead/write a data.* variable

Query Params

HookDescription
useQueryParamRead a single URL query parameter
useQueryParamsRead all URL query parameters
HookDescription
useNavigationNavigate between pages, read current page, and track progress
usePageDataRead page-level system variables (index, progress, timestamps)

User

HookDescription
useUserRead and update built-in user fields (email, name, DOB)
useUserPropertyRead/write a custom user property
useDateOfBirthFormat-aware date of birth input, always stores as ISO

Products & Payments

HookDescription
useProductsAccess the product catalog and selection state
usePaymentRead payment and card authorization state

Tracking

HookDescription
useTrackingFire custom analytics events and identify users

Localization

HookDescription
useTranslationAccess translations, switch locale at runtime
useLocaleRead the browser’s locale, language, timezone

Device & Context

HookDescription
useDeviceInfoRead device, browser, and OS metadata
useSafeAreaCSS safe area insets for notched devices
useKeyboardDetect virtual keyboard visibility and height

Convenience

HookDescription
useFunnelAll major hooks combined into a single object

Advanced

HookDescription
useVariableRead/write any variable by full namespaced ID
useVariablesRead all variables across every namespace
Last updated on