Skip to main content

Giftpurchase

  • Alert key: fourthwall-giftpurchase
  • Source: Fourthwall
  • Event list label: Gift Purchase
  • Carries alert image: yes (extraSettings.contentImage)

Default message template​

{{username}} just bought a gift with amount {{amount}}

Template variables​

Use any of these in alert text, TTS, or chat templates. The same names appear under data.extraSettings.* when you subscribe via Overlay.on('alert').

Template variableOverlay payload fieldDescription
{{username}}data.extraSettings.usernameThe username of the sender
{{email}}data.extraSettings.emailEmail of user
{{message}}data.extraSettings.messageThe message text sent by the user
{{currency}}data.extraSettings.currencyThe currency used
{{amount}}data.extraSettings.amountThe amount sent
{{friendlyId}}data.extraSettings.friendlyIdNo description available yet.
{{quantity}}data.extraSettings.quantityNo description available yet.
{{offer}}data.extraSettings.offerNo description available yet.
{{offerImageUrl}}data.extraSettings.offerImageUrlNo description available yet.
{{gifts}}data.extraSettings.giftsNo description available yet.
{{giftCount}}data.extraSettings.giftCountTikTok battle gift count for this progress update
{{winners}}data.extraSettings.winnersNo description available yet.
{{winnerNames}}data.extraSettings.winnerNamesNo description available yet.
{{winnerCount}}data.extraSettings.winnerCountNo description available yet.
{{firstWinner}}data.extraSettings.firstWinnerNo description available yet.
{{availableGiftCount}}data.extraSettings.availableGiftCountNo description available yet.
{{redeemedGiftCount}}data.extraSettings.redeemedGiftCountNo description available yet.
{{createdAt}}data.extraSettings.createdAtNo description available yet.
{{raw}}data.extraSettings.rawThe raw data that comes in through the platform for the alert. This is useful for custom code when data is needed that we don't provide by default.

Example payloads​

Each scenario below mirrors what Lumia emits in Overlay.on('alert', (data) => …).

$100​

{
"alert": "fourthwall-giftpurchase",
"dynamic": {
"value": 100,
"currency": "USD"
},
"extraSettings": {
"username": "lumiastream",
"avatar": "https://static-cdn.jtvnw.net/jtv_user_pictures/2b1fa336-f9b2-42cf-bd2c-98675da74982-profile_image-70x70.png",
"amount": 100,
"currency": "USD",
"contentImage": "https://cdn.fourthwall.com/storefront-en/_next/image?url=https%3A%2F%2Fcdn.fourthwall.com%2Fpublic%2Flogos%2Ffw-logo-stacked-purple.png",
"email": "",
"message": "",
"friendlyId": "",
"quantity": "",
"offer": "",
"offerImageUrl": "",
"gifts": "",
"giftCount": "",
"winners": "",
"winnerNames": "",
"winnerCount": "",
"firstWinner": "",
"availableGiftCount": "",
"redeemedGiftCount": "",
"createdAt": "",
"raw": ""
}
}

$200​

{
"alert": "fourthwall-giftpurchase",
"dynamic": {
"value": 200,
"currency": "USD"
},
"extraSettings": {
"username": "lumiastream",
"avatar": "https://static-cdn.jtvnw.net/jtv_user_pictures/2b1fa336-f9b2-42cf-bd2c-98675da74982-profile_image-70x70.png",
"amount": 200,
"currency": "USD",
"contentImage": "https://cdn.fourthwall.com/storefront-en/_next/image?url=https%3A%2F%2Fcdn.fourthwall.com%2Fpublic%2Flogos%2Ffw-logo-stacked-purple.png",
"email": "",
"message": "",
"friendlyId": "",
"quantity": "",
"offer": "",
"offerImageUrl": "",
"gifts": "",
"giftCount": "",
"winners": "",
"winnerNames": "",
"winnerCount": "",
"firstWinner": "",
"availableGiftCount": "",
"redeemedGiftCount": "",
"createdAt": "",
"raw": ""
}
}

$300​

{
"alert": "fourthwall-giftpurchase",
"dynamic": {
"value": 300,
"currency": "USD"
},
"extraSettings": {
"username": "lumiastream",
"avatar": "https://static-cdn.jtvnw.net/jtv_user_pictures/2b1fa336-f9b2-42cf-bd2c-98675da74982-profile_image-70x70.png",
"amount": 300,
"currency": "USD",
"contentImage": "https://cdn.fourthwall.com/storefront-en/_next/image?url=https%3A%2F%2Fcdn.fourthwall.com%2Fpublic%2Flogos%2Ffw-logo-stacked-purple.png",
"email": "",
"message": "",
"friendlyId": "",
"quantity": "",
"offer": "",
"offerImageUrl": "",
"gifts": "",
"giftCount": "",
"winners": "",
"winnerNames": "",
"winnerCount": "",
"firstWinner": "",
"availableGiftCount": "",
"redeemedGiftCount": "",
"createdAt": "",
"raw": ""
}
}

Variation conditions​

Dimensions you can branch on when configuring alert variations:

  • RANDOM
  • EQUAL_CURRENCY_NUMBER - Donation Amount is equal to
  • GREATER_CURRENCY_NUMBER - Donation Amount is greater than or equal to
  • EQUAL_VARIABLE