getUserReferralStatus
Ce contenu n’est pas encore disponible dans votre langue.
getUserReferralStatus(
client,options?):Promise<UserReferralStatusType|null>
Defined in: actions/getUserReferralStatus.ts:28
Fetch the current user’s referral status on the current merchant.
The listener resolves the user’s identity (via clientId or wallet session) and checks whether a referral link exists where the user is the referee.
Results are cached in memory for 30 seconds by default. Concurrent calls while a request is in-flight are deduplicated automatically.
Returns null when the user’s identity cannot be resolved.
Parameters
Section titled “Parameters”client
Section titled “client”The current Frak Client
options?
Section titled “options?”Optional cache configuration
cacheTime?
Section titled “cacheTime?”number
Time in ms to cache the result. Default: 30_000 (30s). Set to 0 to disable.
Returns
Section titled “Returns”Promise<UserReferralStatusType | null>
The user’s referral status, or null if identity cannot be resolved
Example
Section titled “Example”const status = await getUserReferralStatus(client);if (status?.isReferred) { console.log("User was referred to this merchant");}