Generate a JSON Web Token (JWT) to securely associate referral data with individual users.
Parameter | Type | Description |
---|---|---|
SECRET | string | Required. The product secret obtained from your Reditus dashboard. Must never be exposed on the client side. |
PRODUCT_ID | string | Required. The unique product identifier from the Reditus configuration. |
USER_ID | string | Required. Your internal user identifier (e.g., database ID) that will be tied to referral data. |
tokenPayload | object | Payload for the JWT. In this example, includes ProductId , UserId , and iat . |
tokenPayload.iat | number | The current time in seconds (issued at). Ensures the token creation time is recorded. |
gr("loadReferralWidget", ...)
(detailed in Loading the Widget).