Skip to content

Commit 8812413

Browse files
authored
Merge pull request #57 from StreamElements/astro-giveaways-topic
Add docs for channel giveaway event
2 parents 13a4514 + ca5798c commit 8812413

3 files changed

Lines changed: 68 additions & 1 deletion

File tree

docs/websockets/examples/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -427,7 +427,7 @@ class Program
427427
## Related Commands
428428

429429
- See the [Websockets](../index.md) documentation for more information on the Astro Websocket Gateway
430-
- Check the available [Topics](../topics/index.md) for subscription
430+
- Check the available [Topics](./topics) for subscription
431431

432432
## FAQ
433433

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
---
2+
id: channel-giveaway
3+
sidebar_label: "Channel Giveaway"
4+
description: "Real-time updates for channel giveaways via WebSocket"
5+
tags:
6+
- websocket
7+
- channel
8+
- giveaway
9+
keywords:
10+
- StreamElements
11+
- WebSocket
12+
- channel update
13+
- giveaway
14+
- real-time data
15+
---
16+
17+
# Channel Giveaway
18+
19+
## Overview
20+
21+
The `channel.giveaway` topic provides real-time updates for an active giveaway. This includes activities such as when a giveaway starts or ends as well as users purchasing tickets, winning the giveaway, and more.
22+
23+
#### Payload
24+
25+
```json
26+
{
27+
"id": "01J6VTDB25SX14GDBDFZWDX3M9",
28+
"ts": "2024-09-03T11:30:39Z",
29+
"type": "message",
30+
"topic": "channel.giveaway",
31+
"room": "5ad23dcc18fff500d78c5348",
32+
"data": {
33+
"channelId": "5ad23dcc18fff500d78c5348",
34+
"giveawayId": "67cf4296216c6ff883878c0a",
35+
"action": "enter",
36+
"state": "running",
37+
"data": {
38+
"totalTickets": 100,
39+
"totalUsers": 10,
40+
"entry": {
41+
"providerId": "14027",
42+
"username": "jtv",
43+
"subscriber": true,
44+
"tickets": 15,
45+
"new": false
46+
}
47+
}
48+
}
49+
}
50+
```

docs/websockets/topics/index.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
---
2+
id: topics
3+
sidebar_label: "Topics"
4+
description: "A list of all available topics for the Astro Websocket Gateway"
5+
tags:
6+
- api
7+
- websockets
8+
- real-time
9+
keywords:
10+
- astro websocket
11+
- streamelements api
12+
- real-time notifications
13+
- websocket connection
14+
- pubsub
15+
---
16+
17+
# Topics

0 commit comments

Comments
 (0)