Skip to content

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

Function: useSetupReferral()

useSetupReferral(): UseQueryResult<null, Error>

Defined in: react/src/hook/useSetupReferral.ts:20

Hook that automatically processes referral context and emits a DOM event on success

Runs once when the Frak client becomes available. Fire-and-forget — the referral result is tracked via a "frak:referral-success" DOM event on window, not via the returned query data.

Returns

UseQueryResult<null, Error>

The query handle (data is not meaningful — listen for REFERRAL_SUCCESS_EVENT on window instead)

See