Skip to content

Commit

Permalink
add code examples for recording storage
Browse files Browse the repository at this point in the history
  • Loading branch information
vagruchi committed Feb 2, 2024
1 parent eb17d79 commit b30e7a0
Showing 1 changed file with 66 additions and 2 deletions.
68 changes: 66 additions & 2 deletions docusaurus/video/docusaurus/docs/api/recording/storage.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,32 @@ Alternatively, you can also have the storage configured and use it for specific
```js
// TODO: code example for Node
// 1. create a new storage with all the required parameters

await serverSideClient.createExternalStorage({
bucket: 'my-bucket',
name: 'my-s3',
storage_type: 's3',
path: 'directory_name/',
aws_s3: {
s3_region: 'us-east-1',
s3_api_key: 'my-access-key',
s3_secret: 'my-secret',
},
});

// 2. update the call type to use the new storage
await serverSideClient.updateCallType('my-call-type', {
settings: {},
grants: {},
notification_settings: {},
external_storage: "my-s3",
});

// 3. alternative, specify the storage when starting call recording
await call.startRecording({
recording_external_storage: "my-s3",
});

```
</TabItem>
<TabItem value="py" label="Python">
Expand All @@ -43,7 +67,34 @@ Alternatively, you can also have the storage configured and use it for specific
</TabItem>
<TabItem value="curl" label="cURL">
```bash
// TODO: curl code example
curl -X POST \
https://video.stream-io-api.com/video/external_storage?api_key=${API_KEY} \
-H "Authorization: ${JWT_TOKEN}" -H "stream-auth-type: jwt" \
-d '{
"name": "my-storage",
"storage_type": "s3",
"bucket": "my-bucket",
"custom_folder": "my-folder",
"s3_region": "us-east-1",
"s3_api_key": "my-api-key",
"s3_secret": "my-secret"
}'


curl -X PATCH \
https://video.stream-io-api.com/video/call_types/${CALL_TYPE_ID}?api_key=${API_KEY} \
-H "Authorization: ${JWT_TOKEN}" -H "stream-auth-type: jwt" \
-d '{
/// TODO: test current structure
"storage_provider": "my-storage"
}'

curl -X POST \
"https://video.stream-io-api.com/video/call/default/${CALL_ID}/start_recording?api_key=${API_KEY}" \
-H "Authorization: ${JWT_TOKEN}" -H "stream-auth-type: jwt" \
-d '{
"recording_storage": "my-storage"
}'
```
</TabItem>
</Tabs>
Expand Down Expand Up @@ -77,7 +128,20 @@ Note: all Stream applications have Stream S3 storage enabled by default. You can
</TabItem>
<TabItem value="curl" label="cURL">
```bash
// TODO: curl code example
curl -X PATCH \
https://video.stream-io-api.com/video/call_types/${CALL_TYPE_ID}?api_key=${API_KEY} \
-H "Authorization: ${JWT_TOKEN}" -H "stream-auth-type: jwt" \
-d '{
/// TODO: test current structure
"storage_provider": "my-storage"
}'

curl -X POST \
"https://video.stream-io-api.com/video/call/default/${CALL_ID}/start_recording?api_key=${API_KEY}" \
-H "Authorization: ${JWT_TOKEN}" -H "stream-auth-type: jwt" \
-d '{
"recording_storage": "my-storage"
}'
```
</TabItem>
</Tabs>
Expand Down

0 comments on commit b30e7a0

Please sign in to comment.