Skip to content

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

Function: processReferral()

processReferral(client, args): "idle" | "processing" | "success" | "no-referrer" | "self-referral"

Defined in: actions/referral/processReferral.ts:140

Handle the full referral interaction flow:

  1. Check if the user has been referred (if not, early exit)
  2. Preflight self-referral check (if yes, early exit)
  3. Track the arrival event
  4. Replace the current URL with the user's own referral context
  5. Return the resulting referral state

Parameters

client

FrakClient

The current Frak Client

args

frakContext?

FrakContext | null

The referral context parsed from the URL

options?

ProcessReferralOptions

Options for URL replacement and merchant context

walletStatus?

WalletStatusReturnType

The current user wallet status

Returns

"idle" | "processing" | "success" | "no-referrer" | "self-referral"

The referral state

See

@frak-labs/core-sdk!ModalStepTypes for modal step types