Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions calls/android/authentication.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -44,24 +44,24 @@ if (loggedInUser != null) {

The `getLoggedInUser()` method returns a `CallUser` object if a user is logged in, or `null` if no session exists.

## Login with UID and API Key
## Login with UID and Auth Key

This method is suitable for development and testing. For production apps, use [Auth Token login](#login-with-auth-token) instead.

<Warning>
**Security Notice**

Using the API Key directly in client code is not recommended for production. Use Auth Token authentication for enhanced security.
Using the Auth Key directly in client code is not recommended for production. Use Auth Token authentication for enhanced security.
</Warning>

<Tabs>
<Tab title="Kotlin">
```kotlin
val uid = "cometchat-uid-1" // Replace with your user's UID
val apiKey = "API_KEY" // Replace with your API Key
val authKey = "AUTH_KEY" // Replace with your Auth Key

if (CometChatCalls.getLoggedInUser() == null) {
CometChatCalls.login(uid, apiKey, object : CometChatCalls.CallbackListener<CallUser>() {
CometChatCalls.login(uid, authKey, object : CometChatCalls.CallbackListener<CallUser>() {
override fun onSuccess(user: CallUser) {
Log.d(TAG, "Login successful: ${user.uid}")
}
Expand All @@ -78,10 +78,10 @@ if (CometChatCalls.getLoggedInUser() == null) {
<Tab title="Java">
```java
String uid = "cometchat-uid-1"; // Replace with your user's UID
String apiKey = "API_KEY"; // Replace with your API Key
String authKey = "AUTH_KEY"; // Replace with your Auth Key

if (CometChatCalls.getLoggedInUser() == null) {
CometChatCalls.login(uid, apiKey, new CometChatCalls.CallbackListener<CallUser>() {
CometChatCalls.login(uid, authKey, new CometChatCalls.CallbackListener<CallUser>() {
@Override
public void onSuccess(CallUser user) {
Log.d(TAG, "Login successful: " + user.getUid());
Expand All @@ -102,12 +102,12 @@ if (CometChatCalls.getLoggedInUser() == null) {
| Parameter | Type | Description |
|-----------|------|-------------|
| `uid` | String | The unique identifier of the user to login |
| `apiKey` | String | Your CometChat API Key |
| `authKey` | String | Your CometChat Auth Key |
| `listener` | CallbackListener | Callback for success/error handling |

## Login with Auth Token

This is the recommended authentication method for production applications. The Auth Token is generated server-side, keeping your API Key secure.
This is the recommended authentication method for production applications. The Auth Token is generated server-side, keeping your Auth Key secure.

### Auth Token Flow

Expand Down Expand Up @@ -210,6 +210,6 @@ Common authentication errors:
|------------|-------------|
| `ERROR_INVALID_UID` | The provided UID is empty or invalid |
| `ERROR_UID_WITH_SPACE` | The UID contains spaces (not allowed) |
| `ERROR_API_KEY_NOT_FOUND` | The API Key is missing or invalid |
| `ERROR_API_KEY_NOT_FOUND` | The Auth Key is missing or invalid |
| `ERROR_BLANK_AUTHTOKEN` | The Auth Token is empty |
| `ERROR_LOGIN_IN_PROGRESS` | A login operation is already in progress |
3 changes: 1 addition & 2 deletions calls/android/overview.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,11 @@ Use this Calls SDK directly only if you need custom call UI or advanced control.

Before integrating the Calls SDK, ensure you have:

1. **CometChat Account**: [Sign up](https://app.cometchat.com/signup) and create an app to get your App ID, Region, and API Key
1. **CometChat Account**: [Sign up](https://app.cometchat.com/signup) and create an app to get your App ID, Region, and Auth Key
2. **CometChat Users**: Users must exist in CometChat to use calling features. For testing, create users via the [Dashboard](https://app.cometchat.com) or [REST API](/rest-api/chat-apis/users/create-user). Authentication is handled by the Calls SDK - see [Authentication](/calls/android/authentication)
3. **Android Requirements**:
- Minimum SDK: API Level 24 (Android 7.0)
- AndroidX compatibility
4. **Permissions**: Camera and microphone permissions for video/audio calls

## Call Flow

Expand Down
18 changes: 9 additions & 9 deletions calls/ios/authentication.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -42,24 +42,24 @@ if (loggedInUser != nil) {

The `getLoggedInUser()` method returns a `CallsUser` object if a user is logged in, or `nil` if no session exists.

## Login with UID and API Key
## Login with UID and Auth Key

This method is suitable for development and testing. For production apps, use [Auth Token login](#login-with-auth-token) instead.

<Warning>
**Security Notice**

Using the API Key directly in client code is not recommended for production. Use Auth Token authentication for enhanced security.
Using the Auth Key directly in client code is not recommended for production. Use Auth Token authentication for enhanced security.
</Warning>

<Tabs>
<Tab title="Swift">
```swift
let uid = "cometchat-uid-1" // Replace with your user's UID
let apiKey = "API_KEY" // Replace with your API Key
let authKey = "AUTH_KEY" // Replace with your Auth Key

if CometChatCalls.getLoggedInUser() == nil {
CometChatCalls.login(UID: uid, apiKey: apiKey, onSuccess: { user in
CometChatCalls.login(UID: uid, authKey: authKey, onSuccess: { user in
print("Login successful: \(user.uid ?? "")")
}, onError: { error in
print("Login failed: \(error.errorDescription)")
Expand All @@ -72,11 +72,11 @@ if CometChatCalls.getLoggedInUser() == nil {
<Tab title="Objective-C">
```objectivec
NSString *uid = @"cometchat-uid-1"; // Replace with your user's UID
NSString *apiKey = @"API_KEY"; // Replace with your API Key
NSString *authKey = @"AUTH_KEY"; // Replace with your Auth Key

if ([CometChatCalls getLoggedInUser] == nil) {
[CometChatCalls loginWithUID:uid
apiKey:apiKey
authKey:authKey
onSuccess:^(CallsUser * user) {
NSLog(@"Login successful: %@", user.uid);
} onError:^(CometChatCallException error) {
Expand All @@ -92,13 +92,13 @@ if ([CometChatCalls getLoggedInUser] == nil) {
| Parameter | Type | Description |
|-----------|------|-------------|
| `UID` | String | The unique identifier of the user to login |
| `apiKey` | String | Your CometChat API Key |
| `authKey` | String | Your CometChat Auth Key |
| `onSuccess` | Closure | Closure called with `CallsUser` on success |
| `onError` | Closure | Closure called with error on failure |

## Login with Auth Token

This is the recommended authentication method for production applications. The Auth Token is generated server-side, keeping your API Key secure.
This is the recommended authentication method for production applications. The Auth Token is generated server-side, keeping your Auth Key secure.

### Auth Token Flow

Expand Down Expand Up @@ -183,6 +183,6 @@ Common authentication errors:
|------------|-------------|
| `ERROR_INVALID_UID` | The provided UID is empty or invalid |
| `ERROR_UID_WITH_SPACE` | The UID contains spaces (not allowed) |
| `ERROR_API_KEY_NOT_FOUND` | The API Key is missing or invalid |
| `ERROR_API_KEY_NOT_FOUND` | The Auth Key is missing or invalid |
| `ERROR_BLANK_AUTHTOKEN` | The Auth Token is empty |
| `ERROR_AUTHTOKEN_WITH_SPACE` | The Auth Token contains spaces |
3 changes: 1 addition & 2 deletions calls/ios/overview.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,12 @@ Use this Calls SDK directly only if you need custom call UI or advanced control.

Before integrating the Calls SDK, ensure you have:

1. **CometChat Account**: [Sign up](https://app.cometchat.com/signup) and create an app to get your App ID, Region, and API Key
1. **CometChat Account**: [Sign up](https://app.cometchat.com/signup) and create an app to get your App ID, Region, and Auth Key
2. **CometChat Users**: Users must exist in CometChat to use calling features. For testing, create users via the [Dashboard](https://app.cometchat.com) or [REST API](/rest-api/chat-apis/users/create-user). Authentication is handled by the Calls SDK - see [Authentication](/calls/ios/authentication)
3. **iOS Requirements**:
- Minimum iOS version: 16.0
- Xcode 14.0 or later
- Swift 5.0 or later
4. **Permissions**: Camera and microphone permissions for video/audio calls

## Call Flow

Expand Down
46 changes: 14 additions & 32 deletions calls/javascript/actions.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ CometChatCalls.muteAudio();

### Unmute Audio

Unmutes your local microphone, resuming audio transmission.
Unmutes your local microphone, resuming audio transmission to other participants.

```javascript
CometChatCalls.unMuteAudio();
Expand All @@ -27,23 +27,23 @@ CometChatCalls.unMuteAudio();

### Pause Video

Turns off your local camera, stopping video transmission. Other participants see your avatar.
Turns off your local camera, stopping video transmission to other participants.

```javascript
CometChatCalls.pauseVideo();
```

### Resume Video

Turns on your local camera, resuming video transmission.
Turns on your local camera, resuming video transmission to other participants.

```javascript
CometChatCalls.resumeVideo();
```

### Switch Camera

Toggles between front and back cameras (on supported devices).
Toggles between front and back cameras (on supported mobile devices).

```javascript
CometChatCalls.switchCamera();
Expand All @@ -61,7 +61,7 @@ CometChatCalls.startScreenSharing();

### Stop Screen Sharing

Stops the current screen share.
Stops sharing your screen with other participants.

```javascript
CometChatCalls.stopScreenSharing();
Expand All @@ -71,7 +71,7 @@ CometChatCalls.stopScreenSharing();

### Start Recording

Begins server-side recording of the call. All participants are notified.
Begins server-side recording of the call.

```javascript
CometChatCalls.startRecording();
Expand All @@ -83,7 +83,7 @@ Recording requires the feature to be enabled for your CometChat app.

### Stop Recording

Stops the current recording. The recording is saved and accessible via the dashboard.
Stops the current ongoing recording. The recording is saved and accessible via the dashboard.

```javascript
CometChatCalls.stopRecording();
Expand All @@ -93,7 +93,7 @@ CometChatCalls.stopRecording();

### Mute Participant

Mutes a specific participant's audio. This is a moderator action.
Mutes a specific participant's audio.

```javascript
CometChatCalls.muteParticipant(participantId);
Expand All @@ -105,7 +105,7 @@ CometChatCalls.muteParticipant(participantId);

### Pause Participant Video

Pauses a specific participant's video. This is a moderator action.
Pauses a specific participant's video.

```javascript
CometChatCalls.pauseParticipantVideo(participantId);
Expand All @@ -117,7 +117,7 @@ CometChatCalls.pauseParticipantVideo(participantId);

### Pin Participant

Pins a participant to keep them prominently displayed regardless of who is speaking.
Pins a participant to the main view.

```javascript
CometChatCalls.pinParticipant(participantId, type);
Expand All @@ -126,11 +126,11 @@ CometChatCalls.pinParticipant(participantId, type);
| Parameter | Type | Description |
|-----------|------|-------------|
| `participantId` | String | The participant's unique identifier |
| `type` | String | The participant type |
| `type` | String | The type of the participant (e.g., `"human"` or `"screen-share"`) |

### Unpin Participant

Removes the pin, returning to automatic speaker highlighting.
Unpins the currently pinned participant, returning to the default layout behavior.

```javascript
CometChatCalls.unpinParticipant();
Expand All @@ -151,8 +151,8 @@ CometChatCalls.setLayout("SPOTLIGHT");
| Value | Description |
|-------|-------------|
| `TILE` | Grid layout with equally-sized tiles |
| `SIDEBAR` | Main speaker with participants in a sidebar |
| `SPOTLIGHT` | Large view for active speaker, small tiles for others |
| `SIDEBAR` | Main speaker/screen in large view, other participants in a sidebar |
| `SPOTLIGHT` | Large view for active speaker, small tiles for other |

## Raise Hand

Expand Down Expand Up @@ -342,21 +342,3 @@ Sets the video input device by device ID.
CometChatCalls.setVideoInputDevice(deviceId);
```

## Picture-in-Picture

### Enable Picture-in-Picture Layout

Enables Picture-in-Picture mode for the call.

```javascript
CometChatCalls.enablePictureInPictureLayout();
```

### Disable Picture-in-Picture Layout

Disables Picture-in-Picture mode.

```javascript
CometChatCalls.disablePictureInPictureLayout();
```

11 changes: 4 additions & 7 deletions calls/javascript/angular-integration.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,8 @@ This guide walks you through integrating the CometChat Calls SDK into an Angular

## Prerequisites

Before you begin, ensure you have:
- A CometChat account with an app created ([Sign up](https://app.cometchat.com/signup))
- Your App ID, Region, and API Key from the CometChat Dashboard
- An Angular 14+ project
- Node.js 16+ installed
Before you begin, make sure you've completed the [prerequisites](/calls/javascript/overview#prerequisites) from the Overview page. You'll also need:
- An Angular project

## Step 1: Install the SDK

Expand Down Expand Up @@ -43,7 +40,7 @@ interface User {
export class CometChatCallsService {
private readonly APP_ID = "YOUR_APP_ID"; // Replace with your App ID
private readonly REGION = "YOUR_REGION"; // Replace with your Region
private readonly API_KEY = "YOUR_API_KEY"; // Replace with your API Key
private readonly AUTH_KEY = "YOUR_AUTH_KEY"; // Replace with your Auth Key

// Observable state
private isReadySubject = new BehaviorSubject<boolean>(false);
Expand Down Expand Up @@ -77,7 +74,7 @@ export class CometChatCallsService {

// Step 3: Login if not already logged in
if (!loggedInUser) {
loggedInUser = await CometChatCalls.login(uid, this.API_KEY);
loggedInUser = await CometChatCalls.login(uid, this.AUTH_KEY);
}

this.userSubject.next(loggedInUser as User);
Expand Down
14 changes: 7 additions & 7 deletions calls/javascript/authentication.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -28,23 +28,23 @@ if (loggedInUser) {

The `getLoggedInUser()` method returns a user object if a user is logged in, or `null` if no session exists.

## Login with UID and API Key
## Login with UID and Auth Key

This method is suitable for development and testing. For production apps, use [Auth Token login](#login-with-auth-token) instead.

<Warning>
**Security Notice**

Using the API Key directly in client code is not recommended for production. Use Auth Token authentication for enhanced security.
Using the Auth Key directly in client code is not recommended for production. Use Auth Token authentication for enhanced security.
</Warning>

```javascript
const uid = "cometchat-uid-1"; // Replace with your user's UID
const apiKey = "API_KEY"; // Replace with your API Key
const authKey = "AUTH_KEY"; // Replace with your Auth Key

if (!CometChatCalls.getLoggedInUser()) {
try {
const user = await CometChatCalls.login(uid, apiKey);
const user = await CometChatCalls.login(uid, authKey);
console.log("Login successful:", user.uid);
} catch (error) {
console.error("Login failed:", error.errorDescription);
Expand All @@ -57,11 +57,11 @@ if (!CometChatCalls.getLoggedInUser()) {
| Parameter | Type | Description |
|-----------|------|-------------|
| `uid` | String | The unique identifier of the user to login |
| `apiKey` | String | Your CometChat API Key |
| `authKey` | String | Your CometChat Auth Key |

## Login with Auth Token

This is the recommended authentication method for production applications. The Auth Token is generated server-side, keeping your API Key secure.
This is the recommended authentication method for production applications. The Auth Token is generated server-side, keeping your Auth Key secure.

### Auth Token Flow

Expand Down Expand Up @@ -144,7 +144,7 @@ Common authentication errors:
|------------|-------------|
| `ERROR_INVALID_UID` | The provided UID is empty or invalid |
| `ERROR_UID_WITH_SPACE` | The UID contains spaces (not allowed) |
| `ERROR_API_KEY_NOT_FOUND` | The API Key is missing or invalid |
| `ERROR_API_KEY_NOT_FOUND` | The Auth Key is missing or invalid |
| `ERROR_BLANK_AUTHTOKEN` | The Auth Token is empty |
| `ERROR_AUTHTOKEN_WITH_SPACE` | The Auth Token contains spaces (not allowed) |
| `ERROR_LOGIN_IN_PROGRESS` | A login operation is already in progress |
Expand Down
Loading