Skip to content

Documentation / @frak-labs/core-sdk / actions / getMergeToken

Function: getMergeToken()

getMergeToken(client, options?): Promise<string | null>

Defined in: actions/getMergeToken.ts:19

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. The token is appended as ?fmt= to the redirect URL.

Results are cached in memory for 30 seconds by default. Concurrent calls while a request is in-flight are deduplicated automatically.

Parameters

client

FrakClient

The current Frak Client

options?

Optional cache configuration

cacheTime?

number

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

Returns

Promise<string | null>

The merge token string, or null if unavailable