Global

Members

purgeInviteCode

Source:

Purge all invite codes that are past their expiration for a month. Runs daily at 12 midnight Hong Kong time.

Methods

createInviteCode(data) → {object}

Source:

Create a new one-time invite code

Example
createInviteCode({
  uid: "hk_wx5555556",
});
Parameters:
Name Type Description
data object

Wrapper object for data

Properties
Name Type Description
uid string

Referrer’s Firebase User ID, e.g. hk_wx5555556.

Requires:
Returns:

Data object of Generated one-time invite code. Including inviteCode, description, expiration, and quota

Type
object

useInviteCode(data) → {boolean}

Source:

Consume an invite code

Example
useInviteCode({
  uid: "hk_wx5555556",
  inviteCode: "ENRICH",
});
Parameters:
Name Type Description
data object

Wrapper object for data

Properties
Name Type Description
uid string

Referee’s Firebase User ID, e.g. hk_wx5555556.

inviteCode string

The invite code

Requires:
Returns:

Return true if invite code has been consumed successfully.

Type
boolean