Skip to content

Commit 2d759b4

Browse files
docs(flutter): Rename Secure Media Access to Token Based File Access
- Update title and sidebarTitle in secure-media-access.mdx - Rename all references from 'Secure Media Access' to 'Token Based File Access' - Update URL references from cometchat.com to cometchat.io - Update overview.mdx, setup.mdx, and send-message.mdx references - Revert UI Kit changes (will be done in separate branch)
1 parent cda377d commit 2d759b4

7 files changed

Lines changed: 18 additions & 104 deletions

File tree

sdk/flutter/overview.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ The `AppSettings` class allows you to configure three settings:
108108
* **autoEstablishSocketConnection(boolean value)**: This property takes a boolean value which when set to true informs the SDK to manage the web-socket connection internally. If set to false, it informs the SDK that the web-socket connection will be managed manually. The default value for this parameter is true. For more information on this, please check the [Connection Behaviour](/sdk/flutter/connection-behaviour) section. The default value for this property is **true.**
109109
* **adminHost(adminHost: string)**: This method takes the admin URL as input and uses this admin URL instead of the default admin URL. This can be used in case of dedicated deployment of CometChat.
110110
* **clientHost(clientHost: string)**: This method takes the client URL as input and uses this client URL instead of the default client URL. This can be used in case of dedicated deployment of CometChat.
111-
* **secureMediaMode(SecureMediaMode mode)**: This method sets the secure media access mode for handling media file URLs. See the [Secure Media Access](/sdk/flutter/secure-media-access) guide for details on available modes and configuration.
111+
* **secureMediaMode(SecureMediaMode mode)**: This method sets the secure media access mode for handling media file URLs. See the [Token Based File Access](/sdk/flutter/secure-media-access) guide for details on available modes and configuration.
112112

113113
<Tabs>
114114
<Tab title="Dart">

sdk/flutter/secure-media-access.mdx

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
2-
title: "Secure Media Access"
3-
sidebarTitle: "Secure Media Access"
2+
title: "Token Based File Access"
3+
sidebarTitle: "Token Based File Access"
44
description: "Control how media files are accessed on CometChat's secure media servers using Embedded, Header-Based, or Presigned token modes."
55
---
66

@@ -27,36 +27,36 @@ await CometChat.init("YOUR_APP_ID", appSettings,
2727
);
2828
2929
// Fetch a time-limited presigned URL for secure media (Header-Based or Presigned mode)
30-
String presignedUrl = await CometChat.fetchPresignedUrl("https://files-<region>.cometchat.com/<app_id>/media/file.jpg");
30+
String presignedUrl = await CometChat.fetchPresignedUrl("https://files-<region>.cometchat.io/<app_id>/media/file.jpg");
3131
3232
// Check if header-based mode is active
3333
bool isHeaderMode = CometChatHelper.isHeaderModeEnabled();
3434
3535
// Check if a URL requires secure access
36-
bool needsSecure = CometChatHelper.requiresSecureAccess("https://files-<region>.cometchat.com/<app_id>/media/file.jpg");
36+
bool needsSecure = CometChatHelper.requiresSecureAccess("https://files-<region>.cometchat.io/<app_id>/media/file.jpg");
3737
```
3838
</Info>
3939

40-
Secure Media Access lets you control how media files (images, videos, audio, documents) are accessed on CometChat's secure media servers. The SDK supports three modes — **Embedded** (FAT appended as a query parameter automatically), **Header-Based** (FAT added in request headers), and **Presigned** (clean URLs where you fetch presigned URLs explicitly). Once Secure Media Access is enabled in the CometChat Dashboard, it cannot be disabled.
40+
Token Based File Access lets you control how media files (images, videos, audio, documents) are accessed on CometChat's secure media servers. The SDK supports three modes — **Embedded** (FAT appended as a query parameter automatically), **Header-Based** (FAT added in request headers), and **Presigned** (clean URLs where you fetch presigned URLs explicitly). Once Token Based File Access is enabled in the CometChat Dashboard, it cannot be disabled.
4141

4242
<Note>
4343
**Available via:** SDK | [REST API](https://api-explorer.cometchat.com) | [CometChat Dashboard](https://app.cometchat.com)
4444
</Note>
4545

4646
<Warning>
47-
Enabling Secure Media Access is **irreversible**. Once you enable this feature in the CometChat Dashboard, it cannot be disabled. All media URLs will require a valid File Access Token (FAT) for access. Make sure your application is ready to handle secure media URLs before enabling.
47+
Enabling Token Based File Access is **irreversible**. Once you enable this feature in the CometChat Dashboard, it cannot be disabled. All media URLs will require a valid File Access Token (FAT) for access. Make sure your application is ready to handle secure media URLs before enabling.
4848
</Warning>
4949

5050
## Prerequisites
5151

52-
Before using Secure Media Access in your application, ensure the following:
52+
Before using Token Based File Access in your application, ensure the following:
5353

5454
1. **Enable in Dashboard:** Navigate to your CometChat Dashboard → **Chats****Settings** and enable the **Token Based File Access** configuration. This is a one-time setup step that activates token-based media access for your app.
5555

5656
2. **SDK Initialization:** Your application must initialize the CometChat SDK with a valid App ID and region before configuring secure media modes. See [Setup](/sdk/flutter/setup) for details.
5757

5858
<Warning>
59-
Once Secure Media Access is enabled, all media URLs served by CometChat's secure media servers require a valid **File Access Token (FAT)** for access. Any request to a media URL without a valid FAT will receive a **401 Unauthorized** response. Ensure your application handles secure media URLs before enabling this feature.
59+
Once Token Based File Access is enabled, all media URLs served by CometChat's secure media servers require a valid **File Access Token (FAT)** for access. Any request to a media URL without a valid FAT will receive a **401 Unauthorized** response. Ensure your application handles secure media URLs before enabling this feature.
6060
</Warning>
6161

6262
## Secure Media Modes
@@ -231,7 +231,7 @@ try {
231231

232232
## How Attachment URLs Differ
233233

234-
When Secure Media Access is enabled, the format of media attachment URLs depends on the configured mode. Understanding this difference is important for rendering media correctly in your application.
234+
When Token Based File Access is enabled, the format of media attachment URLs depends on the configured mode. Understanding this difference is important for rendering media correctly in your application.
235235

236236
### Embedded Mode
237237

@@ -290,7 +290,7 @@ In **Embedded Mode**, you can use attachment URLs directly from message objects.
290290

291291
## API Reference
292292

293-
The following static members are available on the `CometChat` class for working with Secure Media Access:
293+
The following static members are available on the `CometChat` class for working with Token Based File Access:
294294

295295
| Member | Type | Description |
296296
| --- | --- | --- |
@@ -407,11 +407,11 @@ if (needsSecure) {
407407

408408
## Error Handling
409409

410-
When working with Secure Media Access, handle these common error scenarios gracefully in your application.
410+
When working with Token Based File Access, handle these common error scenarios gracefully in your application.
411411

412412
### Feature Not Enabled
413413

414-
If Secure Media Access is not enabled in the CometChat Dashboard, calling `CometChat.fetchPresignedUrl()` will not throw an error — it simply returns the same URL string that was passed in. Media URLs work normally without a File Access Token in this case.
414+
If Token Based File Access is not enabled in the CometChat Dashboard, calling `CometChat.fetchPresignedUrl()` will not throw an error — it simply returns the same URL string that was passed in. Media URLs work normally without a File Access Token in this case.
415415

416416
<Tabs>
417417
<Tab title="Callback">
@@ -594,7 +594,7 @@ loadSecureMedia(mediaUrl);
594594
**Symptom:** Media files fail to load and the server returns a 401 Unauthorized response.
595595

596596
**Possible causes:**
597-
- Secure Media Access is enabled in the Dashboard but the SDK is not configured with a secure media mode.
597+
- Token Based File Access is enabled in the Dashboard but the SDK is not configured with a secure media mode.
598598
- The File Access Token (FAT) has expired or is missing.
599599
- In Header-Based Mode, you are not including the FAT in request headers.
600600
- In Presigned Mode, you are using the raw media URL instead of a presigned URL.

sdk/flutter/send-message.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ To send a media message to any user or group, you need to use the `sendMediaMess
191191

192192
<Note>
193193

194-
If [Secure Media Access](/sdk/flutter/secure-media-access) is enabled for your app, media URLs returned by the SDK may require token-based access. Depending on the configured mode, the SDK either appends a File Access Token (FAT) automatically, requires you to add the FAT to request headers, or requires you to fetch a presigned URL before rendering media. See the [Secure Media Access](/sdk/flutter/secure-media-access) guide for details.
194+
If [Token Based File Access](/sdk/flutter/secure-media-access) is enabled for your app, media URLs returned by the SDK may require token-based access. Depending on the configured mode, the SDK either appends a File Access Token (FAT) automatically, requires you to add the FAT to request headers, or requires you to fetch a presigned URL before rendering media. See the [Token Based File Access](/sdk/flutter/secure-media-access) guide for details.
195195

196196
</Note>
197197

sdk/flutter/setup.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ The `AppSettings` class allows you to configure three settings:
9999
* **autoEstablishSocketConnection(boolean value)**: This property takes a boolean value which when set to true informs the SDK to manage the web-socket connection internally. If set to false, it informs the SDK that the web-socket connection will be managed manually. The default value for this parameter is true. For more information on this, please check the [Connection Behaviour](/sdk/flutter/connection-behaviour) section. The default value for this property is **true.**
100100
* **adminHost(adminHost: string)**: This method takes the admin URL as input and uses this admin URL instead of the default admin URL. This can be used in case of dedicated deployment of CometChat.
101101
* **clientHost(clientHost: string)**: This method takes the client URL as input and uses this client URL instead of the default client URL. This can be used in case of dedicated deployment of CometChat.
102-
* **secureMediaMode(SecureMediaMode mode)**: This method sets the secure media access mode for handling media file URLs. See the [Secure Media Access](/sdk/flutter/secure-media-access) guide for details on available modes and configuration.
102+
* **secureMediaMode(SecureMediaMode mode)**: This method sets the secure media access mode for handling media file URLs. See the [Token Based File Access](/sdk/flutter/secure-media-access) guide for details on available modes and configuration.
103103

104104
<Tabs>
105105
<Tab title="Dart">

ui-kit/flutter/core-features.mdx

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,6 @@ Beyond text, CometChat allows users to share various media types within their co
3434
| [MessageComposer](/ui-kit/flutter/message-composer) | [MessageComposer](/ui-kit/flutter/message-composer) is a Widget that has ActionSheet, ActionSheet is a menu that appears over the context of the app, providing multiple options for sharing media files. |
3535
| [MessageList](/ui-kit/flutter/message-list) | [MessageList](/ui-kit/flutter/message-list) is a Widget that renders different Media Message bubbles like [Image Bubble](/ui-kit/flutter/message-bubble-styling-styling#image-bubble), [File Bubble](/ui-kit/flutter/message-bubble-styling-styling#file-bubble), [Audio Bubble](/ui-kit/flutter/message-bubble-styling-styling#audio-bubble) [Video Bubble](/ui-kit/flutter/message-bubble-styling#video-bubble) |
3636

37-
<Note>
38-
For secure media access using presigned URLs, you can enable Header-Based or Presigned mode during initialization. See [Setting Secure Media Mode](/ui-kit/flutter/methods#setting-secure-media-mode) for configuration details.
39-
</Note>
40-
4137
## Read Receipts
4238

4339
CometChat's Read Receipts feature provides visibility into the message status, letting users know when a message has been delivered and read. This brings clarity to the communication and ensures users are informed about the status of their messages.

ui-kit/flutter/getting-started.mdx

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ To get started, create a new flutter application project.
5353
To use this UI Kit in your Flutter project, you'll need to add the following dependency to the dependencies section of your `pubspec.yaml` file:
5454

5555
```yaml pubspec.yaml
56-
cometchat_chat_uikit: ^5.2.10
56+
cometchat_chat_uikit: ^5.2.8
5757
cometchat_calls_uikit: ^5.0.12 #Optional: Include if you're using Audio/Video Calling
5858
```
5959
@@ -74,7 +74,7 @@ Final `pubspec.yaml`
7474
flutter:
7575
sdk: flutter
7676
77-
cometchat_chat_uikit: ^5.2.10
77+
cometchat_chat_uikit: ^5.2.8
7878
cometchat_calls_uikit: ^5.0.12 #Optional: Include if you're using Audio/Video Calling
7979
cupertino_icons: ^1.0.8
8080
@@ -170,12 +170,6 @@ Before using any features from the CometChat UI Kit, initialize it with your app
170170

171171
> Store your CometChat credentials in a config file to simplify environment management and avoid hardcoding.
172172

173-
<Note>
174-
175-
You can configure secure media access during initialization using `UIKitSettingsBuilder`. To enable presigned URL-based media access, see [Setting Secure Media Mode](/ui-kit/flutter/methods#setting-secure-media-mode).
176-
177-
</Note>
178-
179173
***
180174

181175
### **Step 4: Login to UI Kit**

ui-kit/flutter/methods.mdx

Lines changed: 0 additions & 76 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ Here's the table format for the properties available in `UIKitSettings`:
4040
| **autoEstablishSocketConnection** | `Boolean` | Configures if web socket connections will established automatically on app initialization or be done manually, set to true by default |
4141
| **aiFeature** | `List<AIExtensionDataSource>` | Sets the AI Features that need to be added in UI Kit |
4242
| **extensions** | `List<ExtensionsDataSource>` | Sets the list of extension that need to be added in UI Kit |
43-
| **secureMediaMode** | `SecureMediaMode` | Sets the secure media access mode for handling media file URLs. Options: `embedded`, `headerBased`, `presigned`. See [Secure Media Access](/sdk/flutter/secure-media-access) for details. |
4443

4544
***
4645

@@ -70,81 +69,6 @@ CometChatUIKit.init(uiKitSettings: uiKitSettings,onSuccess: (successMessage) asy
7069

7170
***
7271

73-
### Setting Secure Media Mode
74-
75-
CometChat supports three modes for accessing media files. In **embedded** mode (the default), media URLs include a query-parameter token automatically and no extra steps are needed. In **headerBased** mode, the FAT token is added to request headers for media access. In **presigned** mode, media URLs are resolved via presigned URLs using `CometChat.fetchPresignedUrl(url)`, providing enhanced security for media access.
76-
77-
<Tabs>
78-
<Tab title="Embedded Mode">
79-
```dart
80-
UIKitSettings uiKitSettings = (UIKitSettingsBuilder()
81-
..subscriptionType = CometChatSubscriptionType.allUsers
82-
..autoEstablishSocketConnection = true
83-
..region = "your_region" // Replace with your region
84-
..appId = "your_appID" // Replace with your app Id
85-
..authKey = "your_authKey" // Replace with your app auth key
86-
..secureMediaMode = SecureMediaMode.embedded
87-
).build();
88-
89-
// Initialize CometChat UI Kit with Embedded Secure Media Mode
90-
CometChatUIKit.init(uiKitSettings: uiKitSettings, onSuccess: (successMessage) async {
91-
debugPrint("Initialization completed successfully with embedded secure media mode");
92-
// You can now call login function.
93-
}, onError: (error) {
94-
debugPrint("Initialization failed: ${error.message}");
95-
});
96-
```
97-
</Tab>
98-
99-
<Tab title="Header-Based Mode">
100-
```dart
101-
UIKitSettings uiKitSettings = (UIKitSettingsBuilder()
102-
..subscriptionType = CometChatSubscriptionType.allUsers
103-
..autoEstablishSocketConnection = true
104-
..region = "your_region" // Replace with your region
105-
..appId = "your_appID" // Replace with your app Id
106-
..authKey = "your_authKey" // Replace with your app auth key
107-
..secureMediaMode = SecureMediaMode.headerBased
108-
).build();
109-
110-
// Initialize CometChat UI Kit with Header-Based Secure Media Mode
111-
CometChatUIKit.init(uiKitSettings: uiKitSettings, onSuccess: (successMessage) async {
112-
debugPrint("Initialization completed successfully with header-based secure media mode");
113-
// You can now call login function.
114-
}, onError: (error) {
115-
debugPrint("Initialization failed: ${error.message}");
116-
});
117-
```
118-
</Tab>
119-
120-
<Tab title="Presigned Mode">
121-
```dart
122-
UIKitSettings uiKitSettings = (UIKitSettingsBuilder()
123-
..subscriptionType = CometChatSubscriptionType.allUsers
124-
..autoEstablishSocketConnection = true
125-
..region = "your_region" // Replace with your region
126-
..appId = "your_appID" // Replace with your app Id
127-
..authKey = "your_authKey" // Replace with your app auth key
128-
..secureMediaMode = SecureMediaMode.presigned
129-
).build();
130-
131-
// Initialize CometChat UI Kit with Presigned Secure Media Mode
132-
CometChatUIKit.init(uiKitSettings: uiKitSettings, onSuccess: (successMessage) async {
133-
debugPrint("Initialization completed successfully with presigned secure media mode");
134-
// You can now call login function.
135-
}, onError: (error) {
136-
debugPrint("Initialization failed: ${error.message}");
137-
});
138-
```
139-
</Tab>
140-
</Tabs>
141-
142-
<Note>
143-
For more details on secure media access modes and how to handle media URLs in your application, see the [Secure Media Access](/sdk/flutter/secure-media-access) guide.
144-
</Note>
145-
146-
***
147-
14872
### Login using Auth Key
14973

15074
Only the `UID` of a user is needed to log in. This simple authentication procedure is useful when you are creating a POC or if you are in the development phase. For production apps, we suggest you use [AuthToken](#login-using-auth-token) instead of Auth Key.

0 commit comments

Comments
 (0)