---
# System prepended metadata

title: Topic Payloads

---

Topic Payloads
===

# SNS Topic

## TwitchChatEvent

**Attributes**
* `channel`
* `user`
* `eventType`

**Payload**
```js

```

## GameStats
**Attributes**
None for the beginning, as we bundle multiple games in one message to save actions on the SNS and SQS.

**Payload**
Multiple gamestat objects bundled in a message. (Note: Message should be below 64kbs)
```json
{
    "stats": [
        {
            "name": "RocketLeague", //game name
            "gameId": "3456", //twitch's gameId of the game
            "viewers": 133700, //count of viewers
            "channels": 234, //count of channels
            "date": "2007-08-31T16:47+00:00" //date of scraping
        }
    ]
}
```
---
:::danger
From here on :arrow_down: only old GCP stuff.
:::
## Subscriptions: 
### Events
* RESUBSCRIPTION
* SUBSCRIPTION
* SUBSCRIPTION_GIFT
### PubSub Topic
`twitchSubscription`
### DATA:
OBJECT with the following properties
 - twitchMessageId: `string`
 - receivingUserId: `string`
 - channel: `string` Twitch Channel
 - tier: `string` ['1000', '2000', '3000', 'Prime']
 - payingUserId: `string`
 - months: `number`
 - gifted: `bool`
 - date: `date`

## Cheers
### Events
* CHEER
### PubSubTopic
`twitchCheer`
### DATA: 
OBJECT with the following properties
 - twitchMessageId: `string`
 - channel: `string` Twitch Channel
 - bits: `number`
 - payingUserId: `string`
 - date: `date`

## Raw
Events: ALL
### PubSub Topic
`twitchRaw`
### DATA:
Just a `string` with the raw data from twitch chat.

## Game stats
### PubSub Topic
`twitchGameStats`
### DATA:
OBJECT with the following properties
- name: `string`
- gameId: `number`
- viewers: `number`
- channels: `number`
- date: `date`

## Dead letter
### PubSubTopic
`deadLetter`
### DATA:
OBJECT with the following properties
- topic: `string` - the original pubsub topic the message was sent to
- publishTime: `datetime` - the publishTime of the original message
- data: `string` - the stringified base64 encoded data of the original message
- resolved: `bool` - if the dead letter is resolved by us (maybe for future use)
- error: `string` - stringified error object, why the message got dead
- subscriptionName: `string` - name of the subscription the original message was delivered to or the function/service which received it, as the subscriptionName is not available in CloudFunctions
- attributes: `string` - stringified attributes object of the original message
- messageId: `string` - the original message's messageId