diff --git a/docs.json b/docs.json index a20292af1..2b4df8b74 100644 --- a/docs.json +++ b/docs.json @@ -2605,7 +2605,7 @@ "sdk/javascript/advanced-overview", "sdk/javascript/connection-status", "sdk/javascript/managing-web-sockets-connections-manually", - "sdk/javascript/secure-media-access" + "sdk/javascript/token-based-file-access" ] }, { diff --git a/sdk/javascript/overview.mdx b/sdk/javascript/overview.mdx index 7524f4e3d..e5ee50159 100644 --- a/sdk/javascript/overview.mdx +++ b/sdk/javascript/overview.mdx @@ -305,7 +305,7 @@ The `AppSettings` class allows you to configure the following settings: * **overrideAdminHost(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. * **overrideClientHost(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. * **setStorageMode(storageMode)**: This method allows you to configure how CometChat stores data locally. The storageMode parameter can be set to `CometChat.StorageMode.SESSION` to use session storage, which persists data only for the current browser session, or other available storage modes for different persistence behaviors. -* **setSecureMediaMode(mode)**: This method sets the secure media access mode for handling media file URLs. See the [Secure Media Access](/sdk/javascript/secure-media-access) guide for details on available modes and configuration. +* **setSecureMediaMode(mode)**: This method sets the token based file access mode for handling media file URLs. See the [Token Based File Access](/sdk/javascript/token-based-file-access) guide for details on available modes and configuration. You need to call `init()` before calling any other method from CometChat. We suggest you call the `init()` method on app startup, preferably in the `index.js` file. diff --git a/sdk/javascript/send-message.mdx b/sdk/javascript/send-message.mdx index a471abed3..b3f8466ce 100644 --- a/sdk/javascript/send-message.mdx +++ b/sdk/javascript/send-message.mdx @@ -308,7 +308,7 @@ To send a media message to any user or group, you need to use the `sendMediaMess -If [Secure Media Access](/sdk/javascript/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 or requires you to fetch a presigned URL before rendering media. See the [Secure Media Access](/sdk/javascript/secure-media-access) guide for details. +If [Token Based File Access](/sdk/javascript/token-based-file-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 or requires you to fetch a presigned URL before rendering media. See the [Token Based File Access](/sdk/javascript/token-based-file-access) guide for details. diff --git a/sdk/javascript/setup-sdk.mdx b/sdk/javascript/setup-sdk.mdx index d8de0efae..3f034a5d8 100644 --- a/sdk/javascript/setup-sdk.mdx +++ b/sdk/javascript/setup-sdk.mdx @@ -79,7 +79,7 @@ The `AppSettings` class allows you to configure two settings: * **overrideAdminHost(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. * **overrideClientHost(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. * **setStorageMode(storageMode)**: This method allows you to configure how CometChat stores data locally. The storageMode parameter can be set to `CometChat.StorageMode.SESSION` to use session storage, which persists data only for the current browser session, or other available storage modes for different persistence behaviors. -* **setSecureMediaMode(mode)**: This method sets the secure media access mode for handling media file URLs. See the [Secure Media Access](/sdk/javascript/secure-media-access) guide for details on available modes and configuration. +* **setSecureMediaMode(mode)**: This method sets the token based file access mode for handling media file URLs. See the [Token Based File Access](/sdk/javascript/token-based-file-access) guide for details on available modes and configuration. You need to call `init()` before calling any other method from CometChat. We suggest you call the `init()` method on app startup, preferably in the `index.js` file. diff --git a/sdk/javascript/secure-media-access.mdx b/sdk/javascript/token-based-file-access.mdx similarity index 77% rename from sdk/javascript/secure-media-access.mdx rename to sdk/javascript/token-based-file-access.mdx index 958cd3908..18eae51a2 100644 --- a/sdk/javascript/secure-media-access.mdx +++ b/sdk/javascript/token-based-file-access.mdx @@ -1,7 +1,7 @@ --- -title: "Secure Media Access" -sidebarTitle: "Secure Media Access" -description: "Control how media files are accessed on CometChat's secure media servers using Embedded or Header-Based token modes." +title: "Token Based File Access" +sidebarTitle: "Token Based File Access" +description: "Control how media files are accessed on CometChat's token based file servers using Embedded or Header-Based token modes." --- {/* TL;DR for Agents and Quick Reference */} @@ -9,7 +9,7 @@ description: "Control how media files are accessed on CometChat's secure media s **Quick Reference for AI Agents & Developers** ```javascript -// Configure secure media mode during SDK init +// Configure token based file access mode during SDK init const appSettings = new CometChat.AppSettingsBuilder() .subscribePresenceForAllUsers() .setRegion("YOUR_REGION") @@ -18,42 +18,42 @@ const appSettings = new CometChat.AppSettingsBuilder() await CometChat.init("YOUR_APP_ID", appSettings); -// Fetch a time-limited presigned URL for secure media (Header-Based mode) +// Fetch a time-limited presigned URL for token based file (Header-Based mode) const presignedUrl = await CometChat.fetchPresignedUrl("https://files-.cometchat.com//media/file.jpg"); // Check if header-based mode is active const isHeaderMode = CometChatHelper.isHeaderModeEnabled(); -// Check if a URL requires secure access -const needsSecure = CometChatHelper.requiresSecureAccess("https://files-.cometchat.com//media/file.jpg"); +// Check if a URL requires token based file access +const needsTokenBasedAccess = CometChatHelper.requiresSecureAccess("https://files-.cometchat.com//media/file.jpg"); ``` -Secure Media Access lets you control how media files (images, videos, audio, documents) are accessed on CometChat's secure media servers. The SDK supports two modes — **Embedded** (FAT appended as a query parameter automatically) and **Header-Based** (clean URLs where you fetch presigned URLs explicitly). Once Secure Media Access is enabled in the CometChat Dashboard, it cannot be disabled. +Token Based File Access lets you control how media files (images, videos, audio, documents) are accessed on CometChat's token based file servers. The SDK supports two modes — **Embedded** (FAT appended as a query parameter automatically) and **Header-Based** (clean URLs where you fetch presigned URLs explicitly). Once Token Based File Access is enabled in the CometChat Dashboard, it cannot be disabled. **Available via:** SDK | [REST API](https://api-explorer.cometchat.com) | [CometChat Dashboard](https://app.cometchat.com) -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. +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 token based file URLs before enabling. ## Prerequisites -Before using Secure Media Access in your application, ensure the following: +Before using Token Based File Access in your application, ensure the following: 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. -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](/sdk/javascript/setup-sdk) for details. +2. **SDK Initialization:** Your application must initialize the CometChat SDK with a valid App ID and region before configuring token based file access modes. See [Setup SDK](/sdk/javascript/setup-sdk) for details. -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. +Once Token Based File Access is enabled, all media URLs served by CometChat's token based file 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 token based file URLs before enabling this feature. -## Secure Media Modes +## Token Based File Access Modes -CometChat supports two modes for accessing media files on its secure media servers. The mode is configured during SDK initialization using `AppSettingsBuilder.setSecureMediaMode()`. +CometChat supports two modes for accessing media files on its token based file servers. The mode is configured during SDK initialization using `AppSettingsBuilder.setSecureMediaMode()`. ### Embedded Mode (Default) @@ -75,7 +75,7 @@ Header-Based Mode (`SecureMediaMode.HEADER_BASED = 1`) provides clean media URLs ### SecureMediaMode Enum -The `CometChat.SecureMediaMode` enum defines the available secure media access modes: +The `CometChat.SecureMediaMode` enum defines the available token based file access modes: | Parameter | Type | Description | | --- | --- | --- | @@ -84,12 +84,12 @@ The `CometChat.SecureMediaMode` enum defines the available secure media access m ## Configuration -Configure the secure media mode during SDK initialization using `AppSettingsBuilder.setSecureMediaMode()`. Pass a value from the `CometChat.SecureMediaMode` enum to select your preferred mode. +Configure the token based file access mode during SDK initialization using `AppSettingsBuilder.setSecureMediaMode()`. Pass a value from the `CometChat.SecureMediaMode` enum to select your preferred mode. ```javascript -// Set up app settings with Header-Based secure media mode +// Set up app settings with Header-Based token based file access mode let appID = "YOUR_APP_ID"; let region = "YOUR_REGION"; let appSettings = new CometChat.AppSettingsBuilder() @@ -99,11 +99,11 @@ let appSettings = new CometChat.AppSettingsBuilder() .autoEstablishSocketConnection(true) .build(); -// Initialize the SDK with secure media mode configured +// Initialize the SDK with token based file access mode configured CometChat.init(appID, appSettings).then( () => { console.log("Initialization completed successfully"); - // SDK is now configured for Header-Based secure media access + // SDK is now configured for Header-Based token based file access }, (error) => { console.log("Initialization failed with error:", error); @@ -113,7 +113,7 @@ CometChat.init(appID, appSettings).then( ```typescript -// Set up app settings with Header-Based secure media mode +// Set up app settings with Header-Based token based file access mode let appID: string = "YOUR_APP_ID"; let region: string = "YOUR_REGION"; let appSettings: CometChat.AppSettings = new CometChat.AppSettingsBuilder() @@ -123,11 +123,11 @@ let appSettings: CometChat.AppSettings = new CometChat.AppSettingsBuilder() .autoEstablishSocketConnection(true) .build(); -// Initialize the SDK with secure media mode configured +// Initialize the SDK with token based file access mode configured CometChat.init(appID, appSettings).then( (initialized: boolean) => { console.log("Initialization completed successfully", initialized); - // SDK is now configured for Header-Based secure media access + // SDK is now configured for Header-Based token based file access }, (error: CometChat.CometChatException) => { console.log("Initialization failed with error:", error); @@ -137,7 +137,7 @@ CometChat.init(appID, appSettings).then( ```javascript -// Set up app settings with Header-Based secure media mode +// Set up app settings with Header-Based token based file access mode let appID = "YOUR_APP_ID"; let region = "YOUR_REGION"; let appSettings = new CometChat.AppSettingsBuilder() @@ -147,11 +147,11 @@ let appSettings = new CometChat.AppSettingsBuilder() .autoEstablishSocketConnection(true) .build(); -// Initialize the SDK with secure media mode configured +// Initialize the SDK with token based file access mode configured try { await CometChat.init(appID, appSettings); console.log("Initialization completed successfully"); - // SDK is now configured for Header-Based secure media access + // SDK is now configured for Header-Based token based file access } catch (error) { console.log("Initialization failed with error:", error); } @@ -165,12 +165,12 @@ If you omit `setSecureMediaMode()`, the SDK defaults to **Embedded Mode** (`Secu ## Fetching Presigned URLs -When using **Header-Based Mode**, call `CometChat.fetchPresignedUrl()` to resolve a time-limited presigned URL for any secure media file. The presigned URL grants temporary access to the media file without requiring additional authentication headers. +When using **Header-Based Mode**, call `CometChat.fetchPresignedUrl()` to resolve a time-limited presigned URL for any token based file. The presigned URL grants temporary access to the media file without requiring additional authentication headers. ```javascript -// Fetch a presigned URL for a secure media file +// Fetch a presigned URL for a token based file let mediaUrl = "https://files-.cometchat.com//media/file.jpg"; CometChat.fetchPresignedUrl(mediaUrl).then( @@ -186,7 +186,7 @@ CometChat.fetchPresignedUrl(mediaUrl).then( ```typescript -// Fetch a presigned URL for a secure media file +// Fetch a presigned URL for a token based file let mediaUrl: string = "https://files-.cometchat.com//media/file.jpg"; CometChat.fetchPresignedUrl(mediaUrl).then( @@ -202,7 +202,7 @@ CometChat.fetchPresignedUrl(mediaUrl).then( ```javascript -// Fetch a presigned URL for a secure media file +// Fetch a presigned URL for a token based file let mediaUrl = "https://files-.cometchat.com//media/file.jpg"; try { @@ -220,7 +220,7 @@ try { | Parameter | Type | Description | | --- | --- | --- | -| `url` | `string` | The secure media URL to resolve. Must point to a file hosted on CometChat's secure media servers. | +| `url` | `string` | The token based file URL to resolve. Must point to a file hosted on CometChat's token based file servers. | ### Return Value @@ -230,7 +230,7 @@ try { ## How Attachment URLs Differ -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. +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. ### Embedded Mode @@ -263,21 +263,21 @@ In **Embedded Mode**, you can use attachment URLs directly from message objects. ## API Reference -The following static members are available on the `CometChat` class for working with Secure Media Access: +The following static members are available on the `CometChat` class for working with Token Based File Access: | Member | Type | Description | | --- | --- | --- | -| `CometChat.SecureMediaMode` | `enum` | Enum with two values: `EMBEDDED` (0) and `HEADER_BASED` (1). Used with `AppSettingsBuilder.setSecureMediaMode()` to configure the secure media access mode. | +| `CometChat.SecureMediaMode` | `enum` | Enum with two values: `EMBEDDED` (0) and `HEADER_BASED` (1). Used with `AppSettingsBuilder.setSecureMediaMode()` to configure the token based file access mode. | | `CometChat.getFat()` | `() => string \| null` | Returns the decoded File Access Token (FAT) for the current session, or `null` if no valid FAT is available. | -| `CometChat.fetchPresignedUrl(url)` | `(url: string) => Promise` | Resolves a time-limited presigned URL for the given secure media URL. Used in Header-Based Mode to get a temporary URL that grants access to the media file. | +| `CometChat.fetchPresignedUrl(url)` | `(url: string) => Promise` | Resolves a time-limited presigned URL for the given token based file URL. Used in Header-Based Mode to get a temporary URL that grants access to the media file. | ## Helper Methods -The `CometChatHelper` class provides utility methods to check the current secure media configuration at runtime. These are synchronous methods that return values directly. +The `CometChatHelper` class provides utility methods to check the current token based file configuration at runtime. These are synchronous methods that return values directly. ### isHeaderModeEnabled() -Returns `true` when all three conditions are met: the secure media mode is set to `HEADER_BASED`, a valid FAT exists for the current session, and the secure media host is configured. +Returns `true` when all three conditions are met: the token based file access mode is set to `HEADER_BASED`, a valid FAT exists for the current session, and the token based file host is configured. @@ -333,21 +333,21 @@ if (isEnabled) { | Return Type | Description | | --- | --- | -| `boolean` | `true` if the mode is `HEADER_BASED`, a valid FAT exists, and the secure media host is configured. `false` otherwise. | +| `boolean` | `true` if the mode is `HEADER_BASED`, a valid FAT exists, and the token based file host is configured. `false` otherwise. | ### requiresSecureAccess(url) -Returns `true` if the given URL points to the configured secure media host. Use this to determine whether a URL needs to be resolved via `CometChat.fetchPresignedUrl()` before rendering. +Returns `true` if the given URL points to the configured token based file host. Use this to determine whether a URL needs to be resolved via `CometChat.fetchPresignedUrl()` before rendering. ```javascript -// Check if a URL requires secure access +// Check if a URL requires token based file access let mediaUrl = "https://files-.cometchat.com//media/file.jpg"; -let needsSecure = CometChatHelper.requiresSecureAccess(mediaUrl); -console.log("Requires secure access:", needsSecure); +let needsTokenBasedAccess = CometChatHelper.requiresSecureAccess(mediaUrl); +console.log("Requires token based file access:", needsTokenBasedAccess); -if (needsSecure && CometChatHelper.isHeaderModeEnabled()) { +if (needsTokenBasedAccess && CometChatHelper.isHeaderModeEnabled()) { // Resolve the URL before rendering CometChat.fetchPresignedUrl(mediaUrl).then( (presignedUrl) => { @@ -358,19 +358,19 @@ if (needsSecure && CometChatHelper.isHeaderModeEnabled()) { } ); } else { - // URL does not require secure access or Embedded mode handles it + // URL does not require token based file access or Embedded mode handles it console.log("Use the URL directly:", mediaUrl); } ``` ```typescript -// Check if a URL requires secure access +// Check if a URL requires token based file access let mediaUrl: string = "https://files-.cometchat.com//media/file.jpg"; -let needsSecure: boolean = CometChatHelper.requiresSecureAccess(mediaUrl); -console.log("Requires secure access:", needsSecure); +let needsTokenBasedAccess: boolean = CometChatHelper.requiresSecureAccess(mediaUrl); +console.log("Requires token based file access:", needsTokenBasedAccess); -if (needsSecure && CometChatHelper.isHeaderModeEnabled()) { +if (needsTokenBasedAccess && CometChatHelper.isHeaderModeEnabled()) { // Resolve the URL before rendering CometChat.fetchPresignedUrl(mediaUrl).then( (presignedUrl: string) => { @@ -381,19 +381,19 @@ if (needsSecure && CometChatHelper.isHeaderModeEnabled()) { } ); } else { - // URL does not require secure access or Embedded mode handles it + // URL does not require token based file access or Embedded mode handles it console.log("Use the URL directly:", mediaUrl); } ``` ```javascript -// Check if a URL requires secure access (synchronous check) +// Check if a URL requires token based file access (synchronous check) let mediaUrl = "https://files-.cometchat.com//media/file.jpg"; -let needsSecure = CometChatHelper.requiresSecureAccess(mediaUrl); -console.log("Requires secure access:", needsSecure); +let needsTokenBasedAccess = CometChatHelper.requiresSecureAccess(mediaUrl); +console.log("Requires token based file access:", needsTokenBasedAccess); -if (needsSecure && CometChatHelper.isHeaderModeEnabled()) { +if (needsTokenBasedAccess && CometChatHelper.isHeaderModeEnabled()) { // Resolve the URL before rendering try { const presignedUrl = await CometChat.fetchPresignedUrl(mediaUrl); @@ -402,7 +402,7 @@ if (needsSecure && CometChatHelper.isHeaderModeEnabled()) { console.log("Error fetching presigned URL:", error); } } else { - // URL does not require secure access or Embedded mode handles it + // URL does not require token based file access or Embedded mode handles it console.log("Use the URL directly:", mediaUrl); } ``` @@ -411,19 +411,19 @@ if (needsSecure && CometChatHelper.isHeaderModeEnabled()) { | Parameter | Type | Description | | --- | --- | --- | -| `url` | `string` | The media URL to check. The method compares the URL's host against the configured secure media host. | +| `url` | `string` | The media URL to check. The method compares the URL's host against the configured token based file host. | | Return Type | Description | | --- | --- | -| `boolean` | `true` if the URL points to the configured secure media host. `false` otherwise. | +| `boolean` | `true` if the URL points to the configured token based file host. `false` otherwise. | ## Error Handling -When working with Secure Media Access, handle these common error scenarios gracefully in your application. +When working with Token Based File Access, handle these common error scenarios gracefully in your application. ### Feature Not Enabled -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. +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. @@ -537,7 +537,7 @@ When the File Access Token expires, media requests return a **401 Unauthorized** // Handle expired FAT by re-fetching the presigned URL let mediaUrl = "https://files-.cometchat.com//media/file.jpg"; -function loadSecureMedia(url) { +function loadTokenBasedMedia(url) { CometChat.fetchPresignedUrl(url).then( (presignedUrl) => { console.log("Presigned URL:", presignedUrl); @@ -551,7 +551,7 @@ function loadSecureMedia(url) { ); } -loadSecureMedia(mediaUrl); +loadTokenBasedMedia(mediaUrl); ``` @@ -559,7 +559,7 @@ loadSecureMedia(mediaUrl); // Handle expired FAT by re-fetching the presigned URL let mediaUrl: string = "https://files-.cometchat.com//media/file.jpg"; -function loadSecureMedia(url: string): void { +function loadTokenBasedMedia(url: string): void { CometChat.fetchPresignedUrl(url).then( (presignedUrl: string) => { console.log("Presigned URL:", presignedUrl); @@ -573,7 +573,7 @@ function loadSecureMedia(url: string): void { ); } -loadSecureMedia(mediaUrl); +loadTokenBasedMedia(mediaUrl); ``` @@ -581,7 +581,7 @@ loadSecureMedia(mediaUrl); // Handle expired FAT by re-fetching the presigned URL let mediaUrl = "https://files-.cometchat.com//media/file.jpg"; -async function loadSecureMedia(url) { +async function loadTokenBasedMedia(url) { try { const presignedUrl = await CometChat.fetchPresignedUrl(url); console.log("Presigned URL:", presignedUrl); @@ -593,7 +593,7 @@ async function loadSecureMedia(url) { } } -loadSecureMedia(mediaUrl); +loadTokenBasedMedia(mediaUrl); ``` @@ -659,7 +659,7 @@ loadSecureMedia(mediaUrl); **Symptom:** Media files fail to load and the server returns a 401 Unauthorized response. **Possible causes:** - - Secure Media Access is enabled in the Dashboard but the SDK is not configured with a secure media mode. + - Token Based File Access is enabled in the Dashboard but the SDK is not configured with a token based file access mode. - The File Access Token (FAT) has expired or is missing. - In Header-Based Mode, you are using the raw media URL instead of a presigned URL. @@ -700,13 +700,13 @@ loadSecureMedia(mediaUrl); - Send text, media, and custom messages with secure media support + Send text, media, and custom messages with token based file support - Handle incoming messages and render secure media attachments + Handle incoming messages and render token based file attachments - Configure the SDK with AppSettings including secure media mode + Configure the SDK with AppSettings including token based file access mode Install and initialize the CometChat JavaScript SDK diff --git a/ui-kit/react/core-features.mdx b/ui-kit/react/core-features.mdx index ef581fe73..a31242cec 100644 --- a/ui-kit/react/core-features.mdx +++ b/ui-kit/react/core-features.mdx @@ -35,7 +35,7 @@ Beyond text, CometChat allows users to share various media types within their co | [Message List](/ui-kit/react/message-list) | The [Message List](/ui-kit/react/message-list) component is responsible for rendering various Media Message bubbles, such as Image, File, Audio & Video Bubble. | -For secure media access using presigned URLs, you can enable Header-Based mode during initialization. See [Setting Secure Media Mode](/ui-kit/react/methods#setting-secure-media-mode) for configuration details. +For token based file access using presigned URLs, you can enable Header-Based mode during initialization. See [Setting Token Based File Access Mode](/ui-kit/react/methods#setting-token-based-file-access-mode) for configuration details. ## Read Receipts diff --git a/ui-kit/react/methods.mdx b/ui-kit/react/methods.mdx index e0f4e17d3..983e6bc1c 100644 --- a/ui-kit/react/methods.mdx +++ b/ui-kit/react/methods.mdx @@ -117,7 +117,7 @@ CometChatUIKit.init(UIKitSettings)?.then(() => { -### Setting Secure Media Mode +### Setting Token Based File Access Mode CometChat supports two 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 **HEADER_BASED** mode, media URLs are resolved via presigned URLs using `CometChat.fetchPresignedUrl(url)`, providing enhanced security for media access. @@ -141,9 +141,9 @@ const UIKitSettings = new UIKitSettingsBuilder() .setSecureMediaMode(CometChat.SecureMediaMode.HEADER_BASED) .build(); -//Initialize CometChat UI Kit with Secure Media Mode +//Initialize CometChat UI Kit with Token Based File Access Mode CometChatUIKit.init(UIKitSettings)?.then(() => { - console.log("Initialization completed successfully with secure media mode"); + console.log("Initialization completed successfully with token based file access mode"); // You can now call login function. }) .catch(console.log); @@ -169,9 +169,9 @@ const UIKitSettings = new UIKitSettingsBuilder() .setSecureMediaMode(CometChat.SecureMediaMode.HEADER_BASED) .build(); -//Initialize CometChat UI Kit with Secure Media Mode +//Initialize CometChat UI Kit with Token Based File Access Mode CometChatUIKit.init(UIKitSettings)?.then(() => { - console.log("Initialization completed successfully with secure media mode"); + console.log("Initialization completed successfully with token based file access mode"); // You can now call login function. }) .catch(console.log); diff --git a/ui-kit/react/react-js-integration.mdx b/ui-kit/react/react-js-integration.mdx index 1d6cfc017..967123fa0 100644 --- a/ui-kit/react/react-js-integration.mdx +++ b/ui-kit/react/react-js-integration.mdx @@ -267,7 +267,7 @@ These values are required for proper authentication and seamless integration. -You can configure secure media access during initialization using `UIKitSettingsBuilder`. To enable presigned URL-based media access, see [Setting Secure Media Mode](/ui-kit/react/methods#setting-secure-media-mode). +You can configure token based file access during initialization using `UIKitSettingsBuilder`. To enable presigned URL-based media access, see [Setting Token Based File Access Mode](/ui-kit/react/methods#setting-token-based-file-access-mode).