Skip to content

Commit

Permalink
Added more details for anon users (#576)
Browse files Browse the repository at this point in the history
  • Loading branch information
martinmitrevski authored Oct 17, 2024
1 parent b2671fb commit b7766ec
Showing 1 changed file with 24 additions and 1 deletion.
25 changes: 24 additions & 1 deletion docusaurus/docs/iOS/03-guides/01-client-auth.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ let streamVideo = StreamVideo(
)
```

And here's an example for an anonymous user
And here's an example for an anonymous user:

```swift
let streamVideo = StreamVideo(
Expand All @@ -60,6 +60,29 @@ let streamVideo = StreamVideo(
)
```

Anonymous users don't establish a 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.

Call `cid` consists of the call type and the call id, in the following format: `callType:callId`.

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

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

If you try to join a call that is not listed in the array, you will receive an error.

### Client options

Here's a more complete example of the client options:
Expand Down

0 comments on commit b7766ec

Please sign in to comment.