Skip to content

Commit

Permalink
[doc] add share and follow event
Browse files Browse the repository at this point in the history
  • Loading branch information
zerodytrash committed Aug 30, 2022
1 parent 7d0ca8b commit b788e7f
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,10 @@ Message Events:
- [`liveIntro`](#liveintro)
- [`subscribe`](#subscribe)

Custom Events:
- [`follow`](#follow)
- [`share`](#share)

### Control Events

#### `connected`
Expand Down Expand Up @@ -544,6 +548,27 @@ tiktokChatConnection.on('subscribe', (data) => {
})
```

### Custom Events
These events are based on message events.

#### `follow`
Triggers when a user follows the streamer. Based on `social` event.

```javascript
tiktokChatConnection.on('follow', (data) => {
console.log(data.uniqueId, "followed!");
})
```

#### `share`
Triggers when a user shares the stream. Based on `social` event.

```javascript
tiktokChatConnection.on('share', (data) => {
console.log(data.uniqueId, "shared the stream!");
})
```

## Examples
### Retrieve Room Info
````javascript
Expand Down

0 comments on commit b788e7f

Please sign in to comment.