Skip to content

Commit e66a0cc

Browse files
authored
Add docs for generating developer token (#1002)
1 parent 7c14a1d commit e66a0cc

File tree

2 files changed

+41
-0
lines changed

2 files changed

+41
-0
lines changed
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
---
2+
title: Stream Dev Token
3+
description: How to bypass authentication by using dev token
4+
---
5+
6+
When initializing the Stream Video SDK, a user token is required for authentication. This user token (or access token) contains the security credentials for a login session and uniquely identifies the user. Typically, these tokens should be generated by a secure backend server.
7+
8+
However, there can be scenarios, such as when creating a demonstration application with the Stream Video SDK, where setting up a backend server solely for generating user tokens may not be suitable. To accommodate such situations, the Stream Video SDK provides a convenient method for generating a developer token directly on the client side, eliminating the need for backend complications.
9+
10+
If you want to use devloper tokens for your project, you can follow the instructions below.
11+
12+
1. **Go to the [Dashboard](https://dashboard.getstream.io/)** and select your application.
13+
14+
2. In the **Overview** menu, you can find the **Authentication** category by scrolling to the middle of the page.
15+
16+
3. Toggle on the **Disable Auth Checks** option and **click the Submit** button like the image below.
17+
18+
![Authentication](../assets/dashboard_authentication.png)
19+
20+
4. To obtain the developer token, you can simply use the `StreamVideo.devToken()` method, as shown in the following example:
21+
22+
```kotlin
23+
val userId = "my_user_id"
24+
StreamVideoBuilder(
25+
context = context,
26+
apiKey = BuildConfig.STREAM_API_KEY,
27+
token = StreamVideo.devToken(userId), // here!
28+
user = User(
29+
id = userId,
30+
name = "stream",
31+
image = "http://placekitten.com/200/300",
32+
role = "admin"
33+
)
34+
).build()
35+
```
36+
37+
You can now utilize the developer token within your development environment for user authentication purposes.
38+
39+
:::note
40+
It's important to remember that the developer token should not be used in production-level projects.
41+
:::
31.6 KB
Loading

0 commit comments

Comments
 (0)