How Hooks Work
Autumn’s React hooks connect to your backend via theautumnHandler. When you call a hook, it makes a request to your backend route (e.g., /api/autumn), which securely communicates with Autumn’s API using your secret key.
All hooks are built on TanStack Query and return standard query results (data, isLoading, error, refetch). You can pass queryOptions to customize caching, refetching, and other query behaviors.
Shared Options
Every hook accepts aqueryOptions parameter that forwards to TanStack Query’s useQuery:
enabled- Whether the query should run automaticallystaleTime- How long data is considered fresh (ms)refetchInterval- Polling interval (ms)refetchOnWindowFocus- Refetch when window regains focus

