Skip to content

Commit

Permalink
docs: Added more details for anon users (#1522)
Browse files Browse the repository at this point in the history
Few tickets on support came up, we need to be more clear in the docs.
  • Loading branch information
martinmitrevski authored Oct 16, 2024
1 parent 0b262dc commit 6d25558
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,25 @@ const apiKey = 'my-stream-api-key';
const client = StreamVideoClient.getOrCreateInstance({ apiKey, user });
```

Anonymous users don't establish an active web socket connection, therefore they won't receive any events. They are just able to watch a livestream or join a call.

The token for an anonymous user should contain the `call_cids` field, which is an array of the call `cid`'s that the user is allowed to join.

Here's an example JWT token payload for an anonymous user:

```ts
{
"iss": "@stream-io/dashboard",
"iat": 1726406693,
"exp": 1726493093,
"user_id": "!anon",
"role": "viewer",
"call_cids": [
"livestream:123"
]
}
```

## Client options

### `token` or `tokenProvider`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,25 @@ const apiKey = 'my-stream-api-key';
const client = new StreamVideoClient({ apiKey, user });
```

Anonymous users don't establish an active web socket connection, therefore they won't receive any events. They are just able to watch a livestream or join a call.

The token for an anonymous user should contain the `call_cids` field, which is an array of the call `cid`'s that the user is allowed to join.

Here's an example JWT token payload for an anonymous user:

```ts
{
"iss": "@stream-io/dashboard",
"iat": 1726406693,
"exp": 1726493093,
"user_id": "!anon",
"role": "viewer",
"call_cids": [
"livestream:123"
]
}
```

## Client options

### `token` or `tokenProvider`
Expand Down

0 comments on commit 6d25558

Please sign in to comment.