# Authless Users

Stream Chat also lets you give unauthenticated users with access to a limited subset of Stream's capabilities. This is done by using either Guest or Anonymous users.

These two user types are ideal for use cases where users either need to be able to see chat activity prior to authenticating or in scenarios where the additional friction of creating a user account might be unnecessary for a user.

## Guest Users

Guest sessions can be created client-side and do not require any server-side authentication. Support and livestreams are common use cases for guests users because really often you want a visitor to be able to use chat on your application without (or before) they have a regular user account.

Guest users are not available to application using multi-tenancy (teams).

<admonition type="info">

Guest users are counted towards your MAU usage.

</admonition>

Guest users have a limited set of permissions. You can read more about how to configure permissions [here](/chat/docs/<framework>/chat_permission_policies/). You can create a guest user session by using  `setGuestUser`  instead of  `connectUser` .

You can generate a guest user in a front end client by using the following code:

<codetabs>

<codetabs-item value="kotlin" label="Kotlin">

```kotlin
chatClient.connectGuestUser(userId = "bender", username = "Bender").enqueue { /*... */ }
```

</codetabs-item>

<codetabs-item value="javascript" label="JavaScript">

```js
await client.setGuestUser({ id: "tommaso" });
```

</codetabs-item>

<codetabs-item value="swift" label="Swift">

```swift
chatClient.connectGuestUser(
  userInfo: .init(id: "john-doe")
) { error in
  // …
}
// or
let connectedUser = try await chatClient.connectGuestUser(
  userInfo: .init(id: "john-doe")
)
```

</codetabs-item>

<codetabs-item value="dart" label="Dart">

```dart
await chatClient.connectGuestUser(User('id': 'tommaso'));
```

</codetabs-item>

<codetabs-item value="unreal" label="Unreal">

```cpp
const FUser User{TEXT("tommaso")};
Client->ConnectGuestUser(
  User,
  [](const FOwnUser& Guest)
  {
    // Guest connected
  });
```

</codetabs-item>

<codetabs-item value="java" label="Java">

```java
client.connectGuestUser("bender", "Bender").enqueue(result -> { /* ... */ });
```

</codetabs-item>

<codetabs-item value="unity" label="Unity">

```csharp
// Will be implemented soon, open a GitHub issue if you need this feature -> https://github.com/GetStream/stream-chat-unity/issues/
```

</codetabs-item>

</codetabs>

<admonition type="info">

The user object schema is the same as the one described in the [Setting the user](/chat/docs/<framework>/init_and_users/) portion of the docs.

</admonition>

<admonition type="info">

Creation of guest users can be disabled for your application in the [dashboard](https://getstream.io/dashboard/).

</admonition>

## Anonymous Users

If a user is not logged in, you can call the  `connectAnonymousUser` method. While you’re anonymous, you can’t do much by default, but for the  **livestream**  channel type, you’re still allowed to read the chat conversation.

<codetabs>

<codetabs-item value="kotlin" label="Kotlin">

```kotlin
chatClient.connectAnonymousUser().enqueue { /*... */ }
```

</codetabs-item>

<codetabs-item value="javascript" label="JavaScript">

```js
const connectResponse = await client.connectAnonymousUser();

console.log(connectResponse.me);
```

</codetabs-item>

<codetabs-item value="swift" label="Swift">

```swift
chatClient.connectAnonymousUser() { error in
  // …
}
// or
let connectedUser = try await chatClient.connectAnonymousUser()
```

</codetabs-item>

<codetabs-item value="dart" label="Dart">

```dart
await chatClient.connectAnonymousUser();
```

</codetabs-item>

<codetabs-item value="unreal" label="Unreal">

```cpp
Client->ConnectAnonymousUser(
  [](const FOwnUser& User)
  {
    // Connected
  });
```

</codetabs-item>

<codetabs-item value="java" label="Java">

```java
client.connectAnonymousUser().enqueue(result -> { /* ... */ });
```

</codetabs-item>

<codetabs-item value="unity" label="Unity">

```csharp
// Will be implemented soon, open a GitHub issue if you need this feature -> https://github.com/GetStream/stream-chat-unity/issues/
```

</codetabs-item>

</codetabs>

When you connect to chat using anonymously you receive a special user back with the following data:

<codetabs>

<codetabs-item value="json" label="JSON">

```json
{
  "id": "!anon",
  "role": "anonymous",
  "roles": [],
  "created_at": "0001-01-01T00:00:00Z",
  "updated_at": "0001-01-01T00:00:00Z",
  "last_active": "2020-11-02T18:36:01.125136Z",
  "banned": false,
  "online": true,
  "invisible": false,
  "devices": [],
  "mutes": [],
  "channel_mutes": [],
  "unread_count": 0,
  "total_unread_count": 0,
  "unread_channels": 0,
  "language": ""
}
```

</codetabs-item>

</codetabs>

<admonition type="info">

Anonymous users are not counted toward your MAU number and only have an impact on the number of concurrent connected clients.

</admonition>

<admonition type="info">

Anonymous users are not allowed to perform any write operations

</admonition>

---

This page was last updated at 2025-08-19T14:50:29.998Z.

For the most recent version of this documentation, visit [https://getstream.io/chat/docs/php/authless_users/](https://getstream.io/chat/docs/php/authless_users/).