Skip to content

Commit 6d25558

Browse files
docs: Added more details for anon users (#1522)
Few tickets on support came up, we need to be more clear in the docs.
1 parent 0b262dc commit 6d25558

File tree

2 files changed

+38
-0
lines changed

2 files changed

+38
-0
lines changed

packages/react-native-sdk/docusaurus/docs/reactnative/03-core/01-client-auth.mdx

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,25 @@ const apiKey = 'my-stream-api-key';
7171
const client = StreamVideoClient.getOrCreateInstance({ apiKey, user });
7272
```
7373

74+
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.
75+
76+
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.
77+
78+
Here's an example JWT token payload for an anonymous user:
79+
80+
```ts
81+
{
82+
"iss": "@stream-io/dashboard",
83+
"iat": 1726406693,
84+
"exp": 1726493093,
85+
"user_id": "!anon",
86+
"role": "viewer",
87+
"call_cids": [
88+
"livestream:123"
89+
]
90+
}
91+
```
92+
7493
## Client options
7594

7695
### `token` or `tokenProvider`

packages/react-sdk/docusaurus/docs/React/02-guides/01-client-auth.mdx

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,25 @@ const apiKey = 'my-stream-api-key';
7171
const client = new StreamVideoClient({ apiKey, user });
7272
```
7373

74+
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.
75+
76+
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.
77+
78+
Here's an example JWT token payload for an anonymous user:
79+
80+
```ts
81+
{
82+
"iss": "@stream-io/dashboard",
83+
"iat": 1726406693,
84+
"exp": 1726493093,
85+
"user_id": "!anon",
86+
"role": "viewer",
87+
"call_cids": [
88+
"livestream:123"
89+
]
90+
}
91+
```
92+
7493
## Client options
7594

7695
### `token` or `tokenProvider`

0 commit comments

Comments
 (0)