diff --git a/docusaurus/video/docusaurus/docs/api/_common_/broadcast.mdx b/docusaurus/video/docusaurus/docs/api/_common_/broadcast.mdx
index f2c1305d..28105bc3 100644
--- a/docusaurus/video/docusaurus/docs/api/_common_/broadcast.mdx
+++ b/docusaurus/video/docusaurus/docs/api/_common_/broadcast.mdx
@@ -21,6 +21,15 @@ call.start_hls_broadcasting()
call.stop_hls_broadcasting()
```
+
+
+
+```go
+call.StartHLSBroadcasting(ctx)
+// to end broadcasting
+call.StopHLSBroadcasting(ctx)
+```
+
diff --git a/docusaurus/video/docusaurus/docs/api/_common_/call-type-rtmp-settings.mdx b/docusaurus/video/docusaurus/docs/api/_common_/call-type-rtmp-settings.mdx
index 170ed1aa..bb140d62 100644
--- a/docusaurus/video/docusaurus/docs/api/_common_/call-type-rtmp-settings.mdx
+++ b/docusaurus/video/docusaurus/docs/api/_common_/call-type-rtmp-settings.mdx
@@ -48,6 +48,27 @@ client.video.update_call_type(
+
+
+```go
+response, err := client.Video().UpdateCallType(ctx, callTypeName, &UpdateCallTypeRequest{
+ Settings: &CallSettingsRequest{
+ Broadcasting: &BroadcastSettingsRequest{
+ Enabled: PtrTo(true),
+ Rtmp: &RTMPSettingsRequest{
+ Enabled: PtrTo(true),
+ Quality: PtrTo("1080p"),
+ Layout: &LayoutSettingsRequest{
+ Name: "spotlight",
+ },
+ },
+ },
+ },
+ })
+```
+
+
+
```bash
diff --git a/docusaurus/video/docusaurus/docs/api/_common_/call-types-overview.mdx b/docusaurus/video/docusaurus/docs/api/_common_/call-types-overview.mdx
index ac9f217b..f2fccde6 100644
--- a/docusaurus/video/docusaurus/docs/api/_common_/call-types-overview.mdx
+++ b/docusaurus/video/docusaurus/docs/api/_common_/call-types-overview.mdx
@@ -3,6 +3,7 @@ Call types provide sensible default settings for different use-cases. We provide
- **Default** (`default`) for 1:1 or group calls that use both video and audio
- **Livestreaming** (`livestream`) to build ultra low latency livestreaming for your app on our global edge network. Broadcast from your phone or RTMP and scale to millions of participants.
- **Audio room** (`audio_room`) to build audio experiences for your app. You can build basic calling or feature rich experience like Twitter spaces. Audio quality, reliability and scalability is far ahead of competing solutions.
+- **Development** (`development`) This call type comes with almost all permission settings disabled so that it is simpler to get your initial implementation up and running. You should only use this call type early-on during development.
Each of our [SDKs have tutorials specific for each call type](https://getstream.io/video/sdk/). If you want to know the default settings for each of the call types check out the [Built-in call types page](/api/call_types/builtin).
diff --git a/docusaurus/video/docusaurus/docs/api/_common_/create-call.mdx b/docusaurus/video/docusaurus/docs/api/_common_/create-call.mdx
index ceb36ee6..ef28a34b 100644
--- a/docusaurus/video/docusaurus/docs/api/_common_/create-call.mdx
+++ b/docusaurus/video/docusaurus/docs/api/_common_/create-call.mdx
@@ -4,7 +4,7 @@ import TabItem from '@theme/TabItem';
You can create a call by providing the call type and an ID:
- The [call type](/api/call_types/builtin) controls which features are enabled and sets up permissions. Call type settings and permissions can be set from API, or using the [Stream Dashboard](https://dashboard.getstream.io/).
-- Calls IDs can be reused, which means they can be joined multiple times, so it's possible to set up recurring calls.
+- Calls can be used once or multiple times depending on your app. Unless you want to re-use the same call multiple times, the recommended way to pick a call ID is to use a uuid v4 so that each call gets a unique random ID.
You can specify call members who can receive push notification about the call.
@@ -66,6 +66,37 @@ call.create(
+
+
+```go
+
+import (
+ "github.com/GetStream/getstream-go"
+ "github.com/google/uuid"
+)
+
+call := client.Video().Call("default", uuid.NewString())
+
+members := []getstream.MemberRequest{
+ {UserID: "john", Role: getstream.PtrTo("admin")},
+ {UserID: "jack"},
+}
+
+callRequest := getstream.GetOrCreateCallRequest{
+ Data: &getstream.CallRequest{
+ CreatedByID: getstream.PtrTo("sacha"),
+ Members: members,
+ Custom: map[string]any{
+ "color": "blue",
+ },
+ },
+}
+
+response, err := call.GetOrCreate(ctx, &callRequest)
+```
+
+
+
```bash
diff --git a/docusaurus/video/docusaurus/docs/api/_common_/custom-events.mdx b/docusaurus/video/docusaurus/docs/api/_common_/custom-events.mdx
index c996fb0a..fb89d126 100644
--- a/docusaurus/video/docusaurus/docs/api/_common_/custom-events.mdx
+++ b/docusaurus/video/docusaurus/docs/api/_common_/custom-events.mdx
@@ -22,6 +22,20 @@ call.sendCallEvent({
call.send_call_event(user_id=user.id, custom={"render-animation": "balloons"})
```
+
+
+
+
+```go
+// send a custom event to all users watching the call
+call.SendCallEvent(ctx, &SendCallEventRequest{
+ Custom: &map[string]interface{}{
+ "render-animation": "balloons",
+ },
+ UserID: PtrTo("john"),
+})
+```
+
diff --git a/docusaurus/video/docusaurus/docs/api/_common_/deactivate-reactivate.mdx b/docusaurus/video/docusaurus/docs/api/_common_/deactivate-reactivate.mdx
index 599fe135..98d3b2df 100644
--- a/docusaurus/video/docusaurus/docs/api/_common_/deactivate-reactivate.mdx
+++ b/docusaurus/video/docusaurus/docs/api/_common_/deactivate-reactivate.mdx
@@ -10,12 +10,12 @@ client.deactivateUser({
user_id: '',
});
-//reactivate
+// reactivate
client.reactivateUsers({
user_ids: [''],
});
-// deactivativating users in bulk can take some time
+// deactivating users in bulk is performed asynchronously
const deactivateResponse = client.deactivateUsers({
user_ids: ['', ''...],
});
@@ -31,12 +31,29 @@ client.deactivate_user(user_id=alice.id)
# reactivates the user
client.reactivate_user(user_id=alice.id)
-# deactivates users in bulk, this is an async operation
+# deactivating users in bulk is performed asynchronously
response = client.deactivate_users(user_ids=[alice.id, bob.id])
```
+
+
+```go
+// deactivate one user
+response, err := client.DeactivateUser(ctx, "alice", &getstream.DeactivateUserRequest{})
+
+// reactivates the user
+_, err = client.ReactivateUser(ctx, "alice", &getstream.ReactivateUserRequest{})
+
+// deactivates users in bulk, this is an async operation
+_, err = client.DeactivateUsers(ctx, &getstream.DeactivateUsersRequest{
+ UserIds: []string{"alice", "bob"},
+})
+```
+
+
+
```bash
@@ -66,4 +83,4 @@ Deactivating users in bulk can take some time, this is how you can check the pro
-For more informiation, please refer to the [async operations guide](/api/misc/async)
+For more information, please refer to the [async operations guide](/api/misc/async)
diff --git a/docusaurus/video/docusaurus/docs/api/_common_/delete-users.mdx b/docusaurus/video/docusaurus/docs/api/_common_/delete-users.mdx
index 3aade0b4..f4af5ffc 100644
--- a/docusaurus/video/docusaurus/docs/api/_common_/delete-users.mdx
+++ b/docusaurus/video/docusaurus/docs/api/_common_/delete-users.mdx
@@ -2,20 +2,6 @@ import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
import AsyncTasks from '../_common_/async-tasks.mdx';
-Deleting a user means:
-
-- the user can't connect to Stream API
-- their data won't appear in user queries
-
-Delete has the following opitions:
-
-| Name | Type | Description | Optional |
-| ---------------------- | -------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------- |
-| `user` | Enum (soft, pruning, hard) | - Soft: marks user as deleted and retains all user data.
- Pruning: marks user as deleted and nullifies user information.
- Hard: deletes user completely - this requires hard option for messages and conversation as well. | Yes |
-| `conversations` | Enum (soft, hard) | - Soft: marks all conversation channels as deleted (same effect as Delete Channels with 'hard' option disabled).
- Hard: deletes channel and all its data completely including messages (same effect as Delete Channels with 'hard' option enabled). | Yes |
-| `messages` | Enum (soft, pruning, hard) | - Soft: marks all user messages as deleted without removing any related message data.
- Pruning: marks all user messages as deleted, nullifies message information and removes some message data such as reactions and flags.
- Hard: deletes messages completely with all related information. | Yes |
-| `new_channel_owner_id` | string | Channels owned by hard-deleted users will be transferred to this userID. If you doesn't provide a value, the channel owner will have a system generated ID like `delete-user-8219f6578a7395g` | Yes |
-| `calls` | Enum (soft, hard) | - Soft: marks calls and related data as deleted.
- Hard: deletes calls and related data completely
Note that this applies only to 1:1 calls, not group calls | Yes |
@@ -38,6 +24,17 @@ client.delete_users(user_ids=[""])
client.restore_users(user_ids=[""])
```
+
+
+
+
+```go
+response, err := client.DeleteUsers(ctx, &getstream.DeleteUsersRequest{UserIds: []string{""}})
+
+// restore a soft-deleted user
+_, err = client.RestoreUsers(ctx, &getstream.RestoreUsersRequest{UserIds: []string{""}})
+```
+
@@ -64,8 +61,18 @@ curl -X POST https://video.stream-io-api.com/api/v2/users/restore?api_key=${API_
+The delete users endpoints supports the following parameters to control which data needs to be deleted and how. By default users and their data are soft-deleted.
+
+| Name | Type | Description | Optional |
+| ---------------------- | -------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------- |
+| `user` | Enum (soft, pruning, hard) | - Soft: marks user as deleted and retains all user data.
- Pruning: marks user as deleted and nullifies user information.
- Hard: deletes user completely - this requires hard option for messages and conversation as well. | Yes |
+| `conversations` | Enum (soft, hard) | - Soft: marks all conversation channels as deleted (same effect as Delete Channels with 'hard' option disabled).
- Hard: deletes channel and all its data completely including messages (same effect as Delete Channels with 'hard' option enabled). | Yes |
+| `messages` | Enum (soft, pruning, hard) | - Soft: marks all user messages as deleted without removing any related message data.
- Pruning: marks all user messages as deleted, nullifies message information and removes some message data such as reactions and flags.
- Hard: deletes messages completely with all related information. | Yes |
+| `new_channel_owner_id` | string | Channels owned by hard-deleted users will be transferred to this userID. If you doesn't provide a value, the channel owner will have a system generated ID like `delete-user-8219f6578a7395g` | Yes |
+| `calls` | Enum (soft, hard) | - Soft: marks calls and related data as deleted.
- Hard: deletes calls and related data completely
Note that this applies only to 1:1 calls, not group calls | Yes |
+
Deleting and restoring users in bulk can take some time, this is how you can check the progress:
-For more informiation, please refer to the [async operations guide](/api/misc/async)
+For more information, please refer to the [async operations guide](/api/misc/async)
diff --git a/docusaurus/video/docusaurus/docs/api/_common_/go_live.mdx b/docusaurus/video/docusaurus/docs/api/_common_/go_live.mdx
index f03b162d..6c7544fd 100644
--- a/docusaurus/video/docusaurus/docs/api/_common_/go_live.mdx
+++ b/docusaurus/video/docusaurus/docs/api/_common_/go_live.mdx
@@ -20,6 +20,17 @@ call.go_live(start_hls=True, start_recording=True)
+
+
+```go
+call.GoLive(ctx, &GoLiveRequest{
+ StartHls: PtrTo(true),
+ StartRecording: PtrTo(true),
+})
+```
+
+
+
```bash
diff --git a/docusaurus/video/docusaurus/docs/api/_common_/manage-call-members.mdx b/docusaurus/video/docusaurus/docs/api/_common_/manage-call-members.mdx
index 0a30a8c1..8cb5964f 100644
--- a/docusaurus/video/docusaurus/docs/api/_common_/manage-call-members.mdx
+++ b/docusaurus/video/docusaurus/docs/api/_common_/manage-call-members.mdx
@@ -1,9 +1,13 @@
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
-You can provide a list of call members. Call members need to be existing users. Every call member has a call-level role, [you can configure roles](/api/call_types/permissions/) on the call type.
+You can provide a list of call members, this can be done when you create a call or later on when the call already exists. Please note that call members need to be existing users.
-Call members can receive [push notifications](/api/call_types/settings/#push-notifications-settings).
+There are two reasons to use call members:
+
+- Call membership allows you to have more flexibility when it comes to permissions. The permission system allows you to grant different permissions to users and members, this way one user can be a member on one call or a member on another.
+Membership also allows you to specify a role for user in a call. You can more information about the roles and permissions [here](/api/call_types/permissions/).
+- Call members will receive [push notifications](/api/call_types/settings/#push-notifications-settings).
@@ -31,6 +35,20 @@ call.update_call_members(
)
```
+
+
+
+```go
+// Call members need to be existing users (use `client.UpdateUsers` for that)
+// You can also update the role of existing members
+response, err := call.UpdateCallMembers(ctx, &getstream.UpdateCallMembersRequest{
+ UpdateMembers: []getstream.MemberRequest{
+ {UserID: "sara"},
+ {UserID: "emily", Role: getstream.PtrTo("admin")},
+ },
+})
+```
+
@@ -66,7 +84,18 @@ call.updateCallMembers({
```py
-call.update_call_members(remove_members=["jack", "sara"])
+call.update_call_members(remove_members=["sara"])
+```
+
+
+
+
+```go
+response, err := call.UpdateCallMembers(ctx, &getstream.UpdateCallMembersRequest{
+ RemoveMembers: []string{
+ "sara",
+ },
+})
```
diff --git a/docusaurus/video/docusaurus/docs/api/_common_/rtmp-broadcast-start.mdx b/docusaurus/video/docusaurus/docs/api/_common_/rtmp-broadcast-start.mdx
index 516582ce..40ef9169 100644
--- a/docusaurus/video/docusaurus/docs/api/_common_/rtmp-broadcast-start.mdx
+++ b/docusaurus/video/docusaurus/docs/api/_common_/rtmp-broadcast-start.mdx
@@ -27,6 +27,21 @@ call.start_rtmp_broadcasts(
)
```
+
+
+
+```go
+call.StartRTMPBroadcasts(ctx, &StartRTMPBroadcastsRequest{
+ Broadcasts: []RTMPBroadcastRequest{
+ {
+ Name: "youtube_channel",
+ StreamUrl: "rtmps://x.rtmps.youtube.com/live2",
+ StreamKey: PtrTo("your_stream_key"),
+ },
+ },
+})
+```
+
diff --git a/docusaurus/video/docusaurus/docs/api/_common_/rtmp-broadcast-stop-all.mdx b/docusaurus/video/docusaurus/docs/api/_common_/rtmp-broadcast-stop-all.mdx
index 5b9b7ac8..406d9fb5 100644
--- a/docusaurus/video/docusaurus/docs/api/_common_/rtmp-broadcast-stop-all.mdx
+++ b/docusaurus/video/docusaurus/docs/api/_common_/rtmp-broadcast-stop-all.mdx
@@ -15,6 +15,13 @@ call.stopAllRTMPBroadcasts();
call.stop_all_rtmp_broadcasts()
```
+
+
+
+```go
+call.StopAllRTMPBroadcasts(ctx)
+```
+
diff --git a/docusaurus/video/docusaurus/docs/api/_common_/rtmp-broadcast-stop.mdx b/docusaurus/video/docusaurus/docs/api/_common_/rtmp-broadcast-stop.mdx
index 564317c0..33cea395 100644
--- a/docusaurus/video/docusaurus/docs/api/_common_/rtmp-broadcast-stop.mdx
+++ b/docusaurus/video/docusaurus/docs/api/_common_/rtmp-broadcast-stop.mdx
@@ -15,6 +15,14 @@ call.stopRTMPBroadcast("youtube_channel");
call.stop_rtmp_broadcast(name='youtube_channel')
```
+
+
+
+
+```go
+call.StopRTMPBroadcast(ctx, "youtube_channel", &StopRTMPBroadcastsRequest{})
+```
+
diff --git a/docusaurus/video/docusaurus/docs/api/_common_/rtmp.mdx b/docusaurus/video/docusaurus/docs/api/_common_/rtmp.mdx
index e113ced2..fe2cd911 100644
--- a/docusaurus/video/docusaurus/docs/api/_common_/rtmp.mdx
+++ b/docusaurus/video/docusaurus/docs/api/_common_/rtmp.mdx
@@ -39,6 +39,31 @@ rtmp_url = response.data.call.ingress.rtmp.address
print(rtmp_url, stream_key)
```
+
+
+
+```go
+call := client.Video().Call("default", uuid.New().String())
+// create the call where the RTMP will be sent to
+response, err := call.GetOrCreate(ctx, nil)
+
+// ensure we have a user for the host to send video via RTMP
+client.UpdateUsers(ctx, &UpdateUsersRequest{
+ Users: map[string]UserRequest{
+ "tommaso-the-host": {
+ ID: "tommaso-the-host",
+ },
+ },
+})
+
+// create a token for the user sending video, this can be used as the stream key
+expiration := time.Now().Add(1 * time.Hour)
+streamKey, err := client.CreateToken("tommaso-the-host", &StreamJWTClaims{Expire: &expiration})
+
+rtmpURL := response.Data.Call.Ingress.Rtmp.Address
+fmt.Println("RTMP URL:", rtmpURL, "Stream Key:", streamKey)
+```
+
diff --git a/docusaurus/video/docusaurus/docs/api/_common_/storage.mdx b/docusaurus/video/docusaurus/docs/api/_common_/storage.mdx
index e0eaac43..5a9681e0 100644
--- a/docusaurus/video/docusaurus/docs/api/_common_/storage.mdx
+++ b/docusaurus/video/docusaurus/docs/api/_common_/storage.mdx
@@ -78,6 +78,35 @@ response = client.video.check_external_storage(name='my-s3')
client.video.update_call_type(name='allhands', external_storage='my-s3')
```
+
+
+
+```go
+// 1. create a new storage with all the required parameters
+
+client.CreateExternalStorage(ctx, &CreateExternalStorageRequest{
+ Name: "my-s3",
+ StorageType: "s3",
+ Bucket: "my-bucket",
+ Path: PtrTo("directory_name/"),
+ AwsS3: &S3Request{
+ S3Region: "us-east-1",
+ S3ApiKey: PtrTo("my-access"),
+ S3Secret: PtrTo("my-secret"),
+ },
+})
+
+
+// 2. (Optional) Check storage configuration for correctness
+// In case of any errors, this will throw a StreamAPIException.
+response, err := client.CheckExternalStorage(ctx, "my-s3")
+
+// 3. update the call type to use the new storage
+client.Video().UpdateCallType(ctx, "allhands", &UpdateCallTypeRequest{
+ ExternalStorage: PtrTo("my-s3"),
+})
+```
+
@@ -189,6 +218,27 @@ call.start_transcription(transcription_external_storage="my-storage")
call.start_recording(recording_external_storage="my-storage")
```
+
+
+
+
+```go
+// update the call type to use Stream S3 storage for recordings
+client.Video().UpdateCallType(ctx, "my-call-type", &UpdateCallTypeRequest{
+ ExternalStorage: PtrTo("stream-s3"),
+})
+
+// specify my-storage storage when starting call transcribing
+call.StartTranscription(ctx, &StartTranscriptionRequest{
+ TranscriptionExternalStorage: PtrTo("my-storage"),
+})
+
+// specify my-storage storage for recording
+call.StartRecording(ctx, &StartRecordingRequest{
+ RecordingExternalStorage: PtrTo("my-storage"),
+})
+```
+
@@ -315,6 +365,30 @@ client.create_external_storage(
+
+
+```go
+file, err := os.Open("/path/to/your/service-account-file.json")
+if err != nil {
+ log.Fatal(err)
+}
+defer file.Close()
+creds, err := io.ReadAll(file)
+if err != nil {
+ log.Fatal(err)
+}
+
+client.CreateExternalStorage(ctx, &CreateExternalStorageRequest{
+ Name: "my-gcs",
+ StorageType: "gcs",
+ Bucket: "my-bucket",
+ Path: PtrTo("directory_name/"),
+ GcsCredentials: PtrTo(string(creds)),
+})
+```
+
+
+
```bash
@@ -411,6 +485,26 @@ client.create_external_storage(
+
+
+```go
+client.CreateExternalStorage(ctx, &CreateExternalStorageRequest{
+ Name: "my-abs",
+ StorageType: "abs",
+ Bucket: "my-bucket",
+ Path: PtrTo("directory_name/"),
+ AzureBlob: &AzureRequest{
+ AbsAccountName: "...",
+ AbsClientID: "...",
+ AbsClientSecret: "...",
+ AbsTenantID: "...",
+ },
+},
+)
+```
+
+
+
```bash
diff --git a/docusaurus/video/docusaurus/docs/api/_common_/update-call.mdx b/docusaurus/video/docusaurus/docs/api/_common_/update-call.mdx
index 7e3e017d..1e20c612 100644
--- a/docusaurus/video/docusaurus/docs/api/_common_/update-call.mdx
+++ b/docusaurus/video/docusaurus/docs/api/_common_/update-call.mdx
@@ -36,6 +36,26 @@ call.update(
)
```
+
+
+
+```go
+// update some custom data for this call
+response, err := call.Update(ctx, &getstream.UpdateCallRequest{
+ Custom: map[string]any{"color": "red"},
+})
+
+// update settings for this call
+response, err = call.Update(ctx, &getstream.UpdateCallRequest{
+ SettingsOverride: &getstream.CallSettingsRequest{
+ Screensharing: &getstream.ScreensharingSettingsRequest{
+ Enabled: getstream.PtrTo(true),
+ AccessRequestEnabled: getstream.PtrTo(true),
+ },
+ },
+})
+```
+
diff --git a/docusaurus/video/docusaurus/docs/api/basics/authentication.mdx b/docusaurus/video/docusaurus/docs/api/basics/authentication.mdx
index 8085f735..7a53996e 100644
--- a/docusaurus/video/docusaurus/docs/api/basics/authentication.mdx
+++ b/docusaurus/video/docusaurus/docs/api/basics/authentication.mdx
@@ -12,18 +12,18 @@ import DeleteUsers from '../_common_/delete-users.mdx';
## Creating users
-Stream Users require only an ID to be created. Users can be created with the role of user or admin. The role will be set to user if a value is not provided in the request. There are additional properties you can provide to further describe your users.
-
-The `name` and `image` fields are special fields that are supported by client-side SDKs.
-
-You can provide additional data for the user object using the `custom` field.
+When creating users, there are a few important things to keep in mind:
+- The `id` field is mandatory, in most cases you want this to be the same ID you use on your database.
+- The `role` field is optional, by default it is set to `user` but you can specify any existing role.
+- Custom data can be added to users in the `custom` field.
+- `name` and `image` are optional and handled by all SDKs automatically to render users.
```js
const newUser: UserRequest = {
- id: 'userid',
+ id: 'user-id',
role: 'user',
custom: {
color: 'red',
@@ -51,6 +51,25 @@ client.upsert_users(
)
```
+
+
+
+```go
+response, err := client.UpdateUsers(ctx, &getstream.UpdateUsersRequest{
+ Users: map[string]getstream.UserRequest{
+ "user_id": {
+ ID: "user_id",
+ Role: getstream.PtrTo("admin"),
+ Custom: map[string]interface{}{
+ "color": "red",
+ },
+ Name: getstream.PtrTo("This is a test user"),
+ Image: getstream.PtrTo("link/to/profile/image"),
+ },
+ },
+})
+```
+
@@ -74,36 +93,15 @@ curl -X POST https://video.stream-io-api.com/api/v2/users?api_key=${API_KEY} \
}'
```
-
-
-
-```js
-const userId = 'john';
-const newUser: UserRequest = {
- id: userId,
- role: 'user',
- custom: {
- color: 'red',
- },
- name: 'John',
- image: 'link/to/profile/image',
-};
-await client.upsertUsers({
- users: {
- [newUser.id]: newUser,
- },
-});
-```
-
## Updating users
-There are two ways to update user objects:
+You can update users in two ways:
-- Updating will replace the existing user object
-- Partial update will let you choose which fields you want to change/unset
+- Replace updates: replace the entire user object with the one provided to the API call
+- Partial update: choose which fields you want to change
@@ -113,7 +111,7 @@ const user: UserRequest = {
id: 'userid',
role: 'user',
custom: {
- color: 'red',
+ color: 'blue',
},
name: 'This is a test user',
image: 'link/to/profile/image',
@@ -126,7 +124,7 @@ client.updateUsersPartial({
{
id: user.id,
set: {
- color: 'blue',
+ 'new-field': 'value',
},
unset: ['name'],
},
@@ -142,7 +140,7 @@ client.upsert_users(UserRequest(
id= 'userid',
role= 'user',
custom= {
- "color": 'red',
+ "color": 'blue',
},
name= 'This is a test user',
image= 'link/to/profile/image',
@@ -154,7 +152,7 @@ client.update_users_partial(
UpdateUserPartialRequest(
id="userid",
set={
- "color": "blue",
+ "new-field": "value",
},
unset=["name"],
)
@@ -162,6 +160,38 @@ client.update_users_partial(
)
```
+
+
+
+```go
+response, err := client.UpdateUsers(ctx, &getstream.UpdateUsersRequest{
+ Users: map[string]getstream.UserRequest{
+ "user_id": {
+ ID: "user_id",
+ Role: getstream.PtrTo("user"),
+ Custom: map[string]any{
+ "color": "blue",
+ },
+ Name: getstream.PtrTo("This is a test user"),
+ Image: getstream.PtrTo("link/to/profile/image"),
+ },
+ },
+})
+
+// or
+response, err = client.UpdateUsersPartial(ctx, &getstream.UpdateUsersPartialRequest{
+ Users: []getstream.UpdateUserPartialRequest{
+ {
+ ID: "user_id",
+ Set: map[string]interface{}{
+ "new-field": "value",
+ },
+ Unset: []string{"name"},
+ },
+ },
+})
+```
+
@@ -203,39 +233,6 @@ curl -X PATCH https://video.stream-io-api.com/api/v2/users?api_key=${API_KEY} \
}'
```
-
-
-
-```js
-const user: UserRequest = {
- id: 'userid',
- role: 'user',
- custom: {
- color: 'red',
- },
- name: 'This is a test user',
- image: 'link/to/profile/image',
-};
-client.upsertUsers({
- users: {
- [user.id]: user,
- },
-});
-
-// or
-client.updateUsersPartial({
- users: [
- {
- id: user.id,
- set: {
- color: 'blue',
- },
- unset: ['name'],
- },
- ],
-});
-```
-
@@ -249,31 +246,43 @@ Guest users are temporary user accounts. You can use it to temporarily give some
## Deactivating and deleting users
-While it is usually safer for data retention to deactivate a user, some use cases require completely deleting a user and their data.
+Depending on your use-case, you can choose to delete users or de-activating them. There are some differences between these two approach.
+
+Deactivating users:
+
+- the user will not be allowed to perform API requests / connect
+- user data is retained on Stream's side and returned from API
+- deactivated users can be re-activated
+
+Deleting users:
-Deactivating a user means:
+- the user will no longer be able to perform API requests / connect
+- the user is deleted and by default not returned from API
+- all data from the user is marked as deleted
+- by default the data is retained and "soft" deleted, you can optionally request hard deletion
+- deletion is not reversible
-- the user can't connect to Stream API
-- their data will be retained
-- a deactivated user can be reactivated
+Note: Both deletion and deactivation are performed asynchronously by Stream API. A task ID is returned and you can use that to check the status of its processing.
+### Deactivating users
+### Deleting users
## User tokens
-Stream uses JWT (JSON Web Tokens) to authenticate chat users, enabling them to log in. Knowing whether a user is authorized to perform certain actions is managed separately via a role-based permissions system. Tokens need to be generated server-side.
+Stream uses JWT (JSON Web Tokens) to authenticate users, enabling them to log in. Knowing whether a user is authorized to perform certain actions is managed separately via a role-based permissions system. Tokens need to be generated server-side.
-You can optionally provide an expiration time. By default, tokens are valid for 1 hour.
+You can optionally provide an expiration time.
```js
const userId = 'john';
-// validity is optional (by default the token is valid for an hour)
-const validity = 60 * 60;
+// validity is optional, in this case we set it to 1 day
+const validity = 24 * 60 * 60;
client.generateUserToken({ user_id: userId, validity_in_seconds: validity });
```
@@ -293,8 +302,8 @@ def create_user_token(request):
# The 'user_id' is retrieved from the request's user instance.
user_id = request.user.id
- # the token will be valid for 1 hour
- exp = 3600
+ # the token will be valid for 1 day
+ exp = 24 * 3600
# Here client is Stream client and it's called with the 'user_id' and the expiration time.
token = client.create_token(user_id, expiration=exp)
@@ -305,7 +314,14 @@ def create_user_token(request):
```
+
+
+```go
+// the token will be valid for 1 day
+token, err := client.CreateToken("user-id", getstream.WithExpiration(24*time.Hour))
+```
+
```bash
@@ -320,16 +336,6 @@ SIGNATURE=$(echo -n ${HEADER}.${PAYLOAD} | openssl dgst -sha256 -hmac ${SECRET}
echo "${HEADER}.${PAYLOAD}.${SIGNATURE}"
```
-
-
-
-```js
-const userId = 'john';
-// exp is optional (by default the token is valid for an hour)
-const exp = Math.round(new Date().getTime() / 1000) + 60 * 60;
-client.createToken(userId, exp);
-```
-
@@ -339,8 +345,6 @@ You need to provide the generated tokens to the client SDKs. Stream SDKs accept
Call tokens contain a list of call IDs. When a user utilizes a call token, they will automatically be assigned the membership role for all the calls specified in the token’s claims. Additionally, the token may optionally include alternative roles, such as admin or moderator.
-> **Note:** Call tokens are designed to grant additional access, not restrict it. Most call types let regular users join calls. If all users can access any call, call tokens won't change this. Remove call access from the user role and grant it to specific members instead.
-
@@ -371,6 +375,19 @@ call_cids = ["default:call1", "livestream:call2"]
client.create_call_token(user_id=user_id, expiration=exp, call_cids=call_cids)
```
+
+
+
+```go
+// the list of call IDs this token applies to
+tokenClaims := getstream.Claims{CallCIDs: []string{"default:call1", "livestream:call2"}}
+
+token, err := client.CreateToken("john",
+ getstream.WithClaims(tokenClaims),
+ getstream.WithExpiration(24*time.Hour),
+)
+```
+
@@ -391,21 +408,7 @@ SIGNATURE=$(echo -n ${HEADER}.${PAYLOAD} | openssl dgst -sha256 -hmac ${SECRET}
echo "${HEADER}.${PAYLOAD}.${SIGNATURE}"
```
-
-
-
-```js
-const userId = 'john';
-// exp is optional (by default the token is valid for an hour)
-const exp = Math.round(new Date().getTime() / 1000) + 60 * 60;
-
-const call_cids = ['default:call1', 'livestream:call2'];
-
-client.createCallToken(userId, call_cids, exp);
-
-// Optionally provide a role for the call(s)
-client.createCallToken({ user_id: userId, role: 'admin' }, call_cids);
-```
-
+
+> **Note:** Call tokens are designed to grant additional access, not restrict it. Most call types let regular users join calls. If all users can access any call, call tokens won't change this. Remove call access from the user role and grant it to specific members instead.
diff --git a/docusaurus/video/docusaurus/docs/api/basics/calls.mdx b/docusaurus/video/docusaurus/docs/api/basics/calls.mdx
index 959e39e9..f7ebb635 100644
--- a/docusaurus/video/docusaurus/docs/api/basics/calls.mdx
+++ b/docusaurus/video/docusaurus/docs/api/basics/calls.mdx
@@ -57,6 +57,22 @@ call.get_or_create(
)
```
+
+
+
+```go
+call.GetOrCreate(ctx, &GetOrCreateCallRequest{
+ Ring: PtrTo(true),
+ Data: &CallRequest{
+ CreatedByID: PtrTo("myself"),
+ Members: &[]MemberRequest{
+ {UserID: "myself"},
+ {UserID: "my friend"},
+ },
+ },
+})
+```
+
@@ -115,6 +131,22 @@ call.get_or_create(
)
```
+
+
+
+```go
+call.GetOrCreate(ctx, &GetOrCreateCallRequest{
+ Notify: PtrTo(true),
+ Data: &CallRequest{
+ CreatedByID: PtrTo("myself"),
+ Members: &[]MemberRequest{
+ {UserID: "myself"},
+ {UserID: "my friend"},
+ },
+ },
+})
+```
+
@@ -209,6 +241,23 @@ response = client.video.update_call_type(
)
```
+
+
+
+```go
+response, err := client.Video().UpdateCallType(ctx, "default", &UpdateCallTypeRequest{
+ Grants: &map[string][]string{
+ "user": []string{},
+ "call_member": []string{
+ READ_CALL.String(),
+ SEND_VIDEO.String(),
+ SEND_AUDIO.String(),
+ JOIN_CALL.String(),
+ },
+ },
+})
+```
+
@@ -284,6 +333,13 @@ await call.end();
call.end()
```
+
+
+
+```go
+call.End(ctx)
+```
+
@@ -364,6 +420,37 @@ client.query_calls(
+
+
+```go
+// default sorting
+client.Video().QueryCalls(ctx, &QueryCallsRequest{})
+
+// sorting and pagination
+response, err := client.Video().QueryCalls(ctx, &QueryCallsRequest{
+ Sort: &[]*SortParamRequest{&SortParamRequest{
+ Field: PtrTo("starts_at"),
+ Direction: PtrTo(-1),
+ }
+},
+ Limit: PtrTo(2),
+},
+)
+
+// loading next page
+client.Video().QueryCalls(ctx, &QueryCallsRequest{
+ Sort: &[]*SortParamRequest{&SortParamRequest{
+ Field: PtrTo("starts_at"),
+ Direction: PtrTo(-1),
+ }
+},
+ Limit: PtrTo(2),
+ Next: response.Data.Next,
+})
+```
+
+
+
```bash
@@ -408,6 +495,18 @@ client.video.query_calls(
+
+
+```go
+client.Video().QueryCalls(ctx, &QueryCallsRequest{
+ FilterConditions: &map[string]interface{}{
+ "backstage": false,
+ },
+})
+```
+
+
+
```bash
@@ -452,6 +551,19 @@ client.video.query_calls(
+
+
+```go
+// in next 30 minutes
+inNext30Mins := time.Now().Add(30 * time.Minute)
+client.Video().QueryCalls(ctx, &QueryCallsRequest{
+ FilterConditions: &map[string]interface{}{
+ "starts_at": inNext30Mins.Format(time.RFC3339),
+ },
+})
+```
+
+
```bash
@@ -489,6 +601,18 @@ client.video.query_calls(
+
+
+```go
+client.Video().QueryCalls(ctx, &QueryCallsRequest{
+ FilterConditions: &map[string]interface{}{
+ "ongoing": true,
+ },
+})
+```
+
+
+
```bash
@@ -573,6 +697,44 @@ call.query_members(
+
+
+```go
+// default sorting
+client.Video().QueryCallMembers(ctx, &QueryCallMembersRequest{})
+
+// sorting and pagination
+response, err := client.Video().QueryCallMembers(ctx, &QueryCallMembersRequest{
+ Sort: &[]*SortParamRequest{&SortParamRequest{
+ Field: PtrTo("user_id"),
+ Direction: PtrTo(1),
+ },
+},
+ Limit: PtrTo(2),
+},
+)
+
+// loading next page
+client.Video().QueryCallMembers(ctx, &QueryCallMembersRequest{
+ Sort: &[]*SortParamRequest{&SortParamRequest{
+ Field: PtrTo("user_id"),
+ Direction: PtrTo(1),
+ },
+},
+ Limit: PtrTo(2),
+ Next: response.Data.Next,
+})
+
+// filtering
+client.Video().QueryCallMembers(ctx, &QueryCallMembersRequest{
+ FilterConditions: &map[string]interface{}{
+ "role": "admin",
+ },
+})
+```
+
+
+
```bash
@@ -699,6 +861,23 @@ call.video_pin(session_id="session-id", user_id="user-id-to-pin")
call.video_unpin(session_id="session-id", user_id="user-id-to-unpin")
```
+
+
+
+```go
+// Pin video for all participants
+call.VideoPin(ctx, &PinRequest{
+ SessionID: "session-id",
+ UserID: "user-id-to-pin",
+})
+
+// Unpin video for all participants
+call.VideoUnpin(ctx, &UnpinRequest{
+ SessionID: "session-id",
+ UserID: "user-id-to-unpin",
+})
+```
+
@@ -805,6 +984,31 @@ client.video.update_call_type(
+
+
+
+```go
+// Set default max duration to 1 hour
+client.Video().UpdateCallType(ctx, "default", &UpdateCallTypeRequest{
+ Settings: &CallSettingsRequest{
+ Limits: &LimitsSettingsRequest{
+ MaxDurationSeconds: PtrTo(3600),
+ },
+ },
+})
+
+// Disable the default session timer
+client.Video().UpdateCallType(ctx, "default", &UpdateCallTypeRequest{
+ Settings: &CallSettingsRequest{
+ Limits: &LimitsSettingsRequest{
+ MaxDurationSeconds: PtrTo(0),
+ },
+ },
+})
+```
+
+
+
```bash
@@ -903,6 +1107,23 @@ call.get_or_create(
+
+
+```go
+call.GetOrCreate(ctx, &GetOrCreateCallRequest{
+ Data: &CallRequest{
+ CreatedByID: PtrTo("john"),
+ SettingsOverride: &CallSettingsRequest{
+ Limits: &LimitsSettingsRequest{
+ MaxDurationSeconds: PtrTo(3600),
+ },
+ },
+ },
+})
+```
+
+
+
```bash
@@ -985,6 +1206,29 @@ call.update(
+
+
+```go
+// Updates a call with session timer
+call.Update(ctx, &UpdateCallRequest{
+ SettingsOverride: &CallSettingsRequest{
+ Limits: &LimitsSettingsRequest{
+ MaxDurationSeconds: PtrTo(3600),
+ },
+ },
+})
+
+// Disable the session timer
+call.Update(ctx, &UpdateCallRequest{
+ SettingsOverride: &CallSettingsRequest{
+ Limits: &LimitsSettingsRequest{
+ MaxDurationSeconds: PtrTo(0),
+ },
+ },
+})
+```
+
+
```bash
diff --git a/docusaurus/video/docusaurus/docs/api/basics/get_started.mdx b/docusaurus/video/docusaurus/docs/api/basics/get_started.mdx
index d7e67eac..fa9f7942 100644
--- a/docusaurus/video/docusaurus/docs/api/basics/get_started.mdx
+++ b/docusaurus/video/docusaurus/docs/api/basics/get_started.mdx
@@ -27,6 +27,13 @@ You can reference our [development roadmap](https://github.com/GetStream/protoco
All official SDKs are available on package managers, full source code is available on the GetStream Github organization.
+
+
+```bash
+pip install getstream
+```
+
+
```bash
@@ -36,19 +43,20 @@ yarn add @stream-io/node-sdk
```
-
+
```bash
-pip install getstream
+go get github.com/GetStream/getstream-go
```
-Something doesn't work? You can open a GitHub issue:
+The source code of our SDKs is available on Github. If you find issues with any SDK you can also create an issue on Github directly:
- [Python SDK](https://github.com/GetStream/stream-py)
- [Node SDK](https://github.com/GetStream/stream-node)
+- [Golang SDK](https://github.com/GetStream/getstream-go)
## Creating client
@@ -57,6 +65,15 @@ To create a server-side client, you'll need your **API key** and **secret**. Bot
You can optionally pass a timeout for the API requests, the default timeout is 3000ms.
+
+
+```py
+from getstream import Stream
+
+client = Stream(api_key="your_api_key", api_secret="your_api_secret", timeout=3.0)
+```
+
+
```js
@@ -74,12 +91,16 @@ client = new StreamClient(apiKey, secret, { timeout: 3000 });
```
-
+
-```py
-from getstream import Stream
+```go
+import "github.com/GetStream/getstream-go"
-client = Stream(api_key="your_api_key", api_secret="your_api_secret", timeout=3.0)
+client, err := getstream.NewClient(
+ apiKey,
+ apiSecret,
+ getstream.WithTimeout(10_000*time.Millisecond),
+)
```
@@ -150,6 +171,26 @@ client.upsert_users(
client.create_token(user_id="tommaso-id", expiration=3600)
```
+
+
+
+```go
+// optional values are passed as pointers, you can use `getstream.PtrTo`
+// to get pointers from literals of any type
+response, err := client.UpdateUsers(ctx, &getstream.UpdateUsersRequest{
+ Users: map[string]getstream.UserRequest{
+ "user-id": {
+ ID: "user-id",
+ Name: getstream.PtrTo("tommaso"),
+ Custom: map[string]any{"country": "NL"},
+ },
+ },
+})
+
+// create a user token valid for 24 hours
+token, err := client.CreateToken("tommaso-id", getstream.WithExpiration(24*time.Hour))
+```
+
@@ -174,32 +215,6 @@ curl -X POST https://video.stream-io-api.com/api/v2/users?api_key=${API_KEY} \
}'
```
-
-
-
-```js
-const userId = 'john';
-const newUser: UserRequest = {
- id: userId,
- role: 'user',
- custom: {
- color: 'red',
- },
- name: 'John',
- image: 'link/to/profile/image',
-};
-await client.upsertUsers({
- users: {
- [newUser.id]: newUser,
- },
-});
-
-// exp is optional (by default the token is valid for an hour)
-const exp = Math.round(new Date().getTime() / 1000) + 60 * 60;
-
-client.createToken(userId, exp);
-```
-
diff --git a/docusaurus/video/docusaurus/docs/api/basics/multi-tenant.mdx b/docusaurus/video/docusaurus/docs/api/basics/multi-tenant.mdx
index bc62664f..3ac86693 100644
--- a/docusaurus/video/docusaurus/docs/api/basics/multi-tenant.mdx
+++ b/docusaurus/video/docusaurus/docs/api/basics/multi-tenant.mdx
@@ -47,6 +47,19 @@ print(client.get_app().data.app.multi_tenant_enabled)
client.update_app(multi_tenant_enabled=True)
```
+
+
+
+```go
+res, _ := client.GetApp(ctx)
+fmt.Println(res.Data.App.MultiTenantEnabled)
+
+// enables teams
+client.UpdateApp(ctx, &UpdateAppRequest{
+ MultiTenantEnabled: PtrTo(true),
+})
+```
+
@@ -111,6 +124,23 @@ client.upsert_users(
)
```
+
+
+
+```go
+client.UpdateUsers(ctx, &UpdateUsersRequest{
+ Users: map[string]UserRequest{
+ "john": {
+ ID: "john",
+ Teams: &[]string{
+ "red",
+ "blue",
+ },
+ },
+ },
+})
+```
+
@@ -177,6 +207,19 @@ response = call.create(
)
```
+
+
+
+```go
+call = client.Video().Call("default", "callID")
+response, err := call.GetOrCreate(ctx, &GetOrCreateCallRequest{
+ Data: &CallRequest{
+ Team: PtrTo("blue"),
+ CreatedByID: PtrTo(""),
+ },
+})
+```
+
@@ -256,6 +299,29 @@ response = client.query_users(
)
```
+
+
+
+```go
+response, err := client.QueryUsers(ctx, &QueryUsersRequest{
+ Payload: &QueryUsersPayload{
+ FilterConditions: map[string]interface{}{
+ "name": "Nick",
+ "teams": map[string]interface{}{"$in": []string{"red", "blue"}},
+ },
+ },
+ })
+
+// search for users that are not part of any team
+response, err = client.QueryUsers(ctx, &QueryUsersRequest{
+ Payload: &QueryUsersPayload{
+ FilterConditions: map[string]interface{}{
+ "teams": nil,
+ },
+ },
+})
+```
+
@@ -348,6 +414,27 @@ response = client.video.query_calls(
+
+
+```go
+response, err := client.Video().QueryCalls(ctx, &QueryCallsRequest{
+ FilterConditions: &map[string]interface{}{
+ "id": call_id,
+ "team": map[string]interface{}{"$eq": "blue"},
+ },
+})
+
+// retrieve calls without a team
+response, err := client.Video().QueryCalls(ctx, &QueryCallsRequest{
+ FilterConditions: &map[string]interface{}{
+ "id": call_id,
+ "team": &map[string]interface{}{"$eq": nil},
+ },
+})
+```
+
+
+
```bash
diff --git a/docusaurus/video/docusaurus/docs/api/call_types/geofencing.mdx b/docusaurus/video/docusaurus/docs/api/call_types/geofencing.mdx
index 13abf514..6b7a5148 100644
--- a/docusaurus/video/docusaurus/docs/api/call_types/geofencing.mdx
+++ b/docusaurus/video/docusaurus/docs/api/call_types/geofencing.mdx
@@ -76,6 +76,32 @@ call.create(
)
```
+
+
+
+```go
+client.Video().CreateCallType(ctx, &CreateCallTypeRequest{
+ Name: "",
+ Settings: &CallSettingsRequest{
+ Geofencing: &GeofenceSettingsRequest{
+ Names: &[]string{"european_union"},
+ },
+ },
+})
+
+// override settings on call level
+call.GetOrCreate(ctx, &GetOrCreateCallRequest{
+ Data: &CallRequest{
+ CreatedByID: PtrTo("john"),
+ SettingsOverride: &CallSettingsRequest{
+ Geofencing: &GeofenceSettingsRequest{
+ Names: &[]string{"european_union", "united_states"},
+ },
+ },
+ },
+})
+```
+
diff --git a/docusaurus/video/docusaurus/docs/api/call_types/manage-types.mdx b/docusaurus/video/docusaurus/docs/api/call_types/manage-types.mdx
index a1a9af25..ad691e90 100644
--- a/docusaurus/video/docusaurus/docs/api/call_types/manage-types.mdx
+++ b/docusaurus/video/docusaurus/docs/api/call_types/manage-types.mdx
@@ -30,6 +30,16 @@ client.video.list_call_types()
client.get_call_type(name= 'livestream')
```
+
+
+
+```go
+client.Video().ListCallTypes(ctx)
+
+// or
+client.Video().GetCallType(ctx, "livestream")
+```
+
@@ -92,6 +102,26 @@ client.video.create_call_type(
```
+
+
+
+```go
+client.Video().CreateCallType(ctx, &CreateCallTypeRequest{
+ Name: "allhands",
+ Settings: &CallSettingsRequest{
+ Audio: &AudioSettingsRequest{
+ MicDefaultOn: PtrTo(true),
+ DefaultDevice: "speaker",
+ },
+},
+ Grants: &map[string][]string{
+ "admin": []string{SEND_AUDIO.String(), SEND_VIDEO.String(), MUTE_USERS.String()},
+ "user": []string{SEND_AUDIO.String(), SEND_VIDEO.String()},
+ },
+})
+
+```
+
@@ -142,6 +172,20 @@ client.video.update_call_type(name='allhands',
)
```
+
+
+
+```go
+client.Video().UpdateCallType(ctx, "allhands", &UpdateCallTypeRequest{
+ Settings: &CallSettingsRequest{
+ Audio: &AudioSettingsRequest{
+ MicDefaultOn: PtrTo(false),
+ DefaultDevice: "earpiece",
+ },
+ },
+})
+```
+
@@ -189,6 +233,13 @@ client.video.delete_call_type(name= 'allhands')
```
+
+
+
+```go
+client.Video().DeleteCallType(ctx, "allhands")
+```
+
diff --git a/docusaurus/video/docusaurus/docs/api/call_types/permissions.mdx b/docusaurus/video/docusaurus/docs/api/call_types/permissions.mdx
index 2148ce20..65d8f409 100644
--- a/docusaurus/video/docusaurus/docs/api/call_types/permissions.mdx
+++ b/docusaurus/video/docusaurus/docs/api/call_types/permissions.mdx
@@ -83,6 +83,33 @@ client.video.update_call_type(name = 'default',
+
+
+```go
+client.Video().CreateCallType(ctx, &CreateCallTypeRequest{
+ Name: "allhands",
+ Grants: &map[string][]string{
+ "admin": {
+ SEND_AUDIO.String(),
+ SEND_VIDEO.String(),
+ MUTE_USERS.String(),
+ },
+ "customrole": {
+ SEND_AUDIO.String(),
+ SEND_VIDEO.String(),
+ },
+ },
+})
+
+client.Video().UpdateCallType(ctx, "default", &UpdateCallTypeRequest{
+ Grants: &map[string][]string{
+ /* ... */
+ },
+})
+```
+
+
+
```bash
diff --git a/docusaurus/video/docusaurus/docs/api/call_types/settings.mdx b/docusaurus/video/docusaurus/docs/api/call_types/settings.mdx
index c3e5819a..c2695475 100644
--- a/docusaurus/video/docusaurus/docs/api/call_types/settings.mdx
+++ b/docusaurus/video/docusaurus/docs/api/call_types/settings.mdx
@@ -80,6 +80,34 @@ call.create(
+
+
+```go
+client.Video().CreateCallType(ctx, &CreateCallTypeRequest{
+ Name: "",
+ Settings: &CallSettingsRequest{
+ Screensharing: &ScreensharingSettingsRequest{
+ AccessRequestEnabled: PtrTo(false),
+ Enabled: PtrTo(true),
+ },
+ },
+})
+
+// override settings on call level
+call.GetOrCreate(ctx, &GetOrCreateCallRequest{
+ Data: &CallRequest{
+ CreatedByID: PtrTo("john"),
+ SettingsOverride: &CallSettingsRequest{
+ Screensharing: &ScreensharingSettingsRequest{
+ Enabled: PtrTo(false),
+ },
+ },
+},
+})
+```
+
+
+
```bash
@@ -162,6 +190,27 @@ client.video.create_call_type(
)
```
+
+
+
+```go
+client.Video().CreateCallType(ctx, &CreateCallTypeRequest{
+ Name: "",
+ NotificationSettings: &NotificationSettings{
+ Enabled: true,
+ CallNotification: EventNotificationSettings{
+ Apns: APNS{
+ Title: "{{ user.display_name }} invites you to a call",
+ },
+ Enabled: true,
+ },
+ SessionStarted: EventNotificationSettings{
+ Enabled: false,
+ },
+ },
+})
+```
+
diff --git a/docusaurus/video/docusaurus/docs/api/moderation/overview.mdx b/docusaurus/video/docusaurus/docs/api/moderation/overview.mdx
index 55a3fefd..c52d5a19 100644
--- a/docusaurus/video/docusaurus/docs/api/moderation/overview.mdx
+++ b/docusaurus/video/docusaurus/docs/api/moderation/overview.mdx
@@ -45,6 +45,21 @@ call.block_user(user_id='sara')
call.unblock_user(user_id='sara')
```
+
+
+
+```go
+// Block user
+call.BlockUser(ctx, &BlockUserRequest{
+ UserID: "sara",
+})
+
+// Unblock user
+call.UnblockUser(ctx, &UnblockUserRequest{
+ UserID: "sara",
+})
+```
+
@@ -101,6 +116,20 @@ call.update(
)
```
+
+
+
+```go
+call.Update(ctx, &UpdateCallRequest{
+ SettingsOverride: &CallSettingsRequest{
+ Screensharing: &ScreensharingSettingsRequest{
+ Enabled: PtrTo(true),
+ AccessRequestEnabled: PtrTo(true),
+ },
+ },
+})
+```
+
@@ -152,6 +181,19 @@ call.mute_users(
)
```
+
+
+
+
+```go
+// You can specify which kind of stream(s) to mute
+call.MuteUsers(ctx, &MuteUsersRequest{
+ MuteAllUsers: PtrTo(true),
+ Audio: PtrTo(true),
+ MutedByID: PtrTo("john"),
+})
+```
+
@@ -200,6 +242,22 @@ call.mute_users(
)
```
+
+
+
+
+```go
+call.MuteUsers(ctx, &MuteUsersRequest{
+ UserIDs: &[]string{alice.id,bob.id},
+ Audio: PtrTo(true),
+ Video: PtrTo(true),
+ Screenshare: PtrTo(true),
+ ScreenshareAudio: PtrTo(true),
+ MutedByID: user_id,
+})
+
+```
+
@@ -257,6 +315,16 @@ call.update_user_permissions(
)
```
+
+
+
+```go
+call.UpdateUserPermissions(ctx, &UpdateUserPermissionsRequest{
+ UserID: "sara",
+ GrantPermissions: &[]string{SEND_AUDIO.String()},
+})
+```
+
@@ -301,6 +369,16 @@ call.update_user_permissions(
)
```
+
+
+
+```go
+call.UpdateUserPermissions(ctx, &UpdateUserPermissionsRequest{
+ UserID: "sara",
+ RevokePermissions: &[]string{SEND_AUDIO.String()},
+})
+```
+
@@ -503,6 +581,28 @@ response = client.get_blocked_users(user_id=alice.id)
client.unblock_users(blocked_user_id=bob.id, user_id=alice.id)
```
+
+
+
+```go
+// alice blocks bob
+client.BlockUsers(ctx, &BlockUsersRequest{
+ BlockedUserID: "bob.ID",
+ UserID: &alice.ID,
+})
+
+// list blocked users by alice
+response, err := client.GetBlockedUsers(ctx, &GetBlockedUsersRequest{
+ UserID: &alice.ID,
+})
+
+// alice unblocks bob
+client.UnblockUsers(ctx, &UnblockUsersRequest{
+ BlockedUserID: bob.ID,
+ UserID: &alice.ID,
+})
+```
+
diff --git a/docusaurus/video/docusaurus/docs/api/recording/recording_calls.mdx b/docusaurus/video/docusaurus/docs/api/recording/recording_calls.mdx
index d87e2042..fc39f359 100644
--- a/docusaurus/video/docusaurus/docs/api/recording/recording_calls.mdx
+++ b/docusaurus/video/docusaurus/docs/api/recording/recording_calls.mdx
@@ -33,12 +33,22 @@ call.stopRecording();
```py
-// starts recording
+# starts recording
call.start_recording()
-// stops the recording for the call
+# stops the recording for the call
call.stop_recording()
```
+
+
+
+```go
+// starts recording
+call.StartRecording(ctx,nil)
+
+// stops the recording for the call
+call.StopRecording(ctx,nil)
+```
@@ -74,6 +84,13 @@ call.listRecordings();
call.list_recordings()
```
+
+
+
+```go
+call.ListRecordings(ctx)
+```
+
@@ -107,6 +124,13 @@ call.deleteRecording({ session: '', filename: '' });
call.delete_recording(sessionID, filename)
```
+
+
+
+```go
+call.DeleteRecording(ctx, "session_id","filename")
+```
+
@@ -243,6 +267,60 @@ call.update(
+
+
+```go
+// Disable on call level
+call.Update(ctx, &UpdateCallRequest{
+ SettingsOverride: &CallSettingsRequest{
+ Recording: &RecordSettingsRequest{
+ Mode: "disabled",
+ },
+ },
+})
+
+// Disable on call type level
+call_type_name := "default"
+client.Video().UpdateCallType(ctx, call_type_name, &UpdateCallTypeRequest{
+ Settings: &CallSettingsRequest{
+ Recording: &RecordSettingsRequest{
+ Mode: "disabled",
+ },
+ },
+})
+
+// Automatically record calls
+client.Video().UpdateCallType(ctx, call_type_name, &UpdateCallTypeRequest{
+ Settings: &CallSettingsRequest{
+ Recording: &RecordSettingsRequest{
+ Mode: "auto-on",
+ Quality: PtrTo("720p"),
+ },
+ },
+})
+
+// Enable recording feature for a specific call
+call.Update(ctx, &UpdateCallRequest{
+ SettingsOverride: &CallSettingsRequest{
+ Recording: &RecordSettingsRequest{
+ Mode: "available",
+ },
+ },
+})
+
+// Other settings
+call.Update(ctx, &UpdateCallRequest{
+ SettingsOverride: &CallSettingsRequest{
+ Recording: &RecordSettingsRequest{
+ Mode: "available",
+ Quality: PtrTo("1080p"),
+ },
+ },
+})
+```
+
+
+
```bash
@@ -381,6 +459,21 @@ call.update(
)
```
+
+
+
+```go
+// Set recording only for audio
+call.Update(ctx, &UpdateCallRequest{
+ SettingsOverride: &CallSettingsRequest{
+ Recording: &RecordSettingsRequest{
+ Mode: "available",
+ AudioOnly: PtrTo(true),
+ },
+ },
+})
+```
+
@@ -545,6 +638,40 @@ client.video.update_call_type(
)
```
+
+
+
+```go
+layoutOptions := map[string]any{
+ "logo.image_url": "https://theme.zdassets.com/theme_assets/9442057/efc3820e436f9150bc8cf34267fff4df052a1f9c.png",
+ "logo.horizontal_position": "center",
+ "title.text": "Building Stream Video Q&A",
+ "title.horizontal_position": "center",
+ "title.color": "black",
+ "participant_label.border_radius": "0px",
+ "participant.border_radius": "0px",
+ "layout.spotlight.participants_bar_position": "top",
+ "layout.background_color": "#f2f2f2",
+ "participant.placeholder_background_color": "#1f1f1f",
+ "layout.single-participant.padding_inline": "20%",
+ "participant_label.background_color": "transparent",
+}
+
+client.Video().UpdateCallType(ctx, "callTypeName", &UpdateCallTypeRequest{
+ Settings: &CallSettingsRequest{
+ Recording: &RecordSettingsRequest{
+ Mode: "available",
+ AudioOnly: PtrTo(false),
+ Quality: PtrTo("1080p"),
+ Layout: &LayoutSettingsRequest{
+ Name: "spotlight",
+ Options: &layoutOptions,
+ },
+ },
+ },
+})
+```
+
@@ -825,6 +952,26 @@ client.video.update_call_type(
+
+
+
+```go
+client.Video().UpdateCallType(ctx, "callTypeName", &UpdateCallTypeRequest{
+ Settings: &CallSettingsRequest{
+ Recording: &RecordSettingsRequest{
+ Mode: "available",
+ AudioOnly: PtrTo(false),
+ Quality: PtrTo("1080p"),
+ Layout: &LayoutSettingsRequest{
+ Name: "spotlight",
+ ExternalCssUrl: PtrTo("https://path/to/custom.css"),
+ },
+ },
+ },
+})
+```
+
+
```bash
@@ -917,6 +1064,26 @@ client.video.update_call_type(
)
```
+
+
+
+```go
+
+client.Video().UpdateCallType(ctx, "callTypeName", &UpdateCallTypeRequest{
+ Settings: &CallSettingsRequest{
+ Recording: &RecordSettingsRequest{
+ Mode: "available",
+ AudioOnly: PtrTo(false),
+ Quality: PtrTo("1080p"),
+ Layout: &LayoutSettingsRequest{
+ Name: "custom",
+ ExternalAppUrl: PtrTo("https://path/to/layout/app"),
+ },
+ },
+ },
+})
+```
+
diff --git a/docusaurus/video/docusaurus/docs/api/streaming/backstage.mdx b/docusaurus/video/docusaurus/docs/api/streaming/backstage.mdx
index b57d4dad..c67f738b 100644
--- a/docusaurus/video/docusaurus/docs/api/streaming/backstage.mdx
+++ b/docusaurus/video/docusaurus/docs/api/streaming/backstage.mdx
@@ -64,7 +64,29 @@ response = call.get_or_create(
```
+
+
+```go
+// create a call with backstage enabled, starts_at set
+// and join_ahead_of_time_seconds set to 5 minutes
+starts_at := time.Now().Add(30 * time.Minute)
+
+call := client.Video().Call("livestream", uuid.New().String())
+response, err := call.GetOrCreate(ctx, &GetOrCreateCallRequest{
+ Data: &CallRequest{
+ StartsAt: &Timestamp{Time: starts_at},
+ CreatedByID: PtrTo("john"),
+ SettingsOverride: &CallSettingsRequest{
+ Backstage: &BackstageSettingsRequest{
+ Enabled: PtrTo(true),
+ JoinAheadTimeSeconds: PtrTo(300),
+ },
+ },
+ },
+})
+```
+
```bash
@@ -163,6 +185,33 @@ client.video.update_call_type(
)
```
+
+
+
+
+```go
+// call level update
+call.Update(ctx, &UpdateCallRequest{
+ SettingsOverride: &CallSettingsRequest{
+ Backstage: &BackstageSettingsRequest{
+ Enabled: PtrTo(true),
+ JoinAheadTimeSeconds: PtrTo(300),
+ },
+ },
+})
+
+// call type level update
+call_type_name := ""
+client.Video().UpdateCallType(ctx, call_type_name, &UpdateCallTypeRequest{
+ Settings: &CallSettingsRequest{
+ Backstage: &BackstageSettingsRequest{
+ Enabled: PtrTo(true),
+ JoinAheadTimeSeconds: PtrTo(300),
+ },
+ },
+})
+```
+
@@ -252,6 +301,19 @@ client.video.update_call_type(
)
```
+
+
+
+
+```go
+callTypeName := ""
+client.Video().UpdateCallType(ctx, callTypeName, &UpdateCallTypeRequest{
+ Grants: &map[string][]string{
+ "host": []string{JOIN_BACKSTAGE.String()},
+ },
+})
+```
+
@@ -314,6 +376,14 @@ call.stopLive();
call.stop_live()
```
+
+
+
+
+```go
+call.StopLive(ctx)
+```
+
diff --git a/docusaurus/video/docusaurus/docs/api/streaming/hls.mdx b/docusaurus/video/docusaurus/docs/api/streaming/hls.mdx
index 5df46797..f3259339 100644
--- a/docusaurus/video/docusaurus/docs/api/streaming/hls.mdx
+++ b/docusaurus/video/docusaurus/docs/api/streaming/hls.mdx
@@ -51,6 +51,14 @@ response = call.get()
print(f"broadcasting: {response.data.call.egress.broadcasting}")
```
+
+
+
+```go
+response, err := call.Get(ctx,nil)
+fmt.Printf("broadcasting: %v", response.Data.Call.Egress.Broadcasting)
+```
+
@@ -95,7 +103,13 @@ response.data.call.egress.hls.playlist_url
```
+
+```go
+response, err := call.Get(ctx,nil)
+fmt.Printf("HLS URL: %v", response.Data.Call.Egress.Hls.PlaylistUrl)
+```
+
```bash
diff --git a/docusaurus/video/docusaurus/docs/api/streaming/overview.mdx b/docusaurus/video/docusaurus/docs/api/streaming/overview.mdx
index a0882d71..1d15f3b8 100644
--- a/docusaurus/video/docusaurus/docs/api/streaming/overview.mdx
+++ b/docusaurus/video/docusaurus/docs/api/streaming/overview.mdx
@@ -64,6 +64,23 @@ response = call.create(
)
```
+
+
+
+```go
+
+call := client.Video().Call("livestream", callID)
+response, err := call.GetOrCreate(ctx, &GetOrCreateCallRequest{
+ Data: &CallRequest{
+ CreatedByID: PtrTo("john"),
+ // You can add multiple hosts if you want to
+ Members: &[]MemberRequest{
+ {UserID: "john", Role: PtrTo("host")},
+ },
+ },
+})
+```
+
diff --git a/docusaurus/video/docusaurus/docs/api/streaming/rtmp_broadcast.mdx b/docusaurus/video/docusaurus/docs/api/streaming/rtmp_broadcast.mdx
index 30e380b7..566d2bd4 100644
--- a/docusaurus/video/docusaurus/docs/api/streaming/rtmp_broadcast.mdx
+++ b/docusaurus/video/docusaurus/docs/api/streaming/rtmp_broadcast.mdx
@@ -101,6 +101,21 @@ is_rtmp_broadcasting = len(rtmp_broadcasts) > 0
print(f"rtmp broadcasting: {is_rtmp_broadcasting}")
```
+
+
+
+```go
+response, err := call.Get(ctx,nil)
+
+// If HLS or any RTMP broadcast active
+fmt.Printf("broadcasting: %v", response.Data.Call.Egress.Broadcasting)
+
+// Only check for RTMP broadcasts
+rtmp_broadcasts := response.Data.Call.Egress.Rtmps
+is_rtmp_broadcasting := len(rtmp_broadcasts) > 0
+fmt.Printf("rtmp broadcasting: %v", is_rtmp_broadcasting)
+```
+
diff --git a/docusaurus/video/docusaurus/docs/api/transcription/transcribing_calls.mdx b/docusaurus/video/docusaurus/docs/api/transcription/transcribing_calls.mdx
index fd999ff6..55704b6f 100644
--- a/docusaurus/video/docusaurus/docs/api/transcription/transcribing_calls.mdx
+++ b/docusaurus/video/docusaurus/docs/api/transcription/transcribing_calls.mdx
@@ -40,6 +40,16 @@ call.start_transcription()
call.stop_transcription()
```
+
+
+
+```go
+call.StartTranscription(ctx, nil)
+
+// stops the transcription for the call
+call.StopTranscription(ctx)
+```
+
@@ -78,6 +88,13 @@ call.listTranscriptions();
call.list_transcriptions()
```
+
+
+
+```go
+call.ListTranscriptions(ctx)
+```
+
@@ -111,6 +128,13 @@ call.deleteTranscription({ session: '', filename: '' });
call.delete_transcription(sessionID, filename)
```
+
+
+
+```go
+call.DeleteTranscription(ctx, sessionID, filename)
+```
+
@@ -258,6 +282,51 @@ client.update(
)
```
+
+
+
+```go
+// Disable on call level
+call.Update(ctx, &UpdateCallRequest{
+ SettingsOverride: &CallSettingsRequest{
+ Transcription: &TranscriptionSettingsRequest{
+ Mode: "disabled",
+ },
+ },
+})
+
+// Disable on call type level
+call_type_name := "default"
+
+// Disable transcription
+_, err := client.Video().UpdateCallType(ctx, call_type_name, &UpdateCallTypeRequest{
+ Settings: &CallSettingsRequest{
+ Transcription: &TranscriptionSettingsRequest{
+ Mode: "disabled",
+ },
+ },
+})
+
+// Automatically transcribe calls
+_, err = client.Video().UpdateCallType(ctx, call_type_name, &UpdateCallTypeRequest{
+ Settings: &CallSettingsRequest{
+ Transcription: &TranscriptionSettingsRequest{
+ Mode: "auto-on",
+ },
+ },
+})
+
+// Enable transcription (available)
+call := client.Video().Call("call_type", "call_id")
+_, err = call.Update(ctx, &UpdateCallRequest{
+ SettingsOverride: &CallSettingsRequest{
+ Transcription: &TranscriptionSettingsRequest{
+ Mode: "available",
+ },
+ },
+})
+```
+