Skip to content

Documentation / @frak-labs/react-sdk / useGetMergeToken

Function: useGetMergeToken()

useGetMergeToken(args?): UseQueryResult<string | null, FrakRpcError<undefined>>

Defined in: react/src/hook/useGetMergeToken.ts:43

Hook that return a query to fetch a merge token for the current anonymous identity

Used by in-app browser redirect flows to preserve identity when switching from a WebView to the system browser.

It's a `tanstack` wrapper around the `getMergeToken()` action

Parameters

args?

Optional config object with query for customizing the underlying `useQuery()`

cacheTime?

number

Time in ms to cache the result at the core SDK level. Default: 30_000 (30s). Set to 0 to disable.

query?

QueryOptions

Optional query options, see `useQuery()` for more infos

Returns

UseQueryResult<string | null, FrakRpcError<undefined>>

The query hook wrapping the getMergeToken() action The data result is a string | null

See