> ## Documentation Index
> Fetch the complete documentation index at: https://www.cometchat.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Setup

> CometChat Calling SDK v4 - Stable Release - Setup for Flutter

### Get your Application Keys

[Signup for CometChat](https://app.cometchat.com) and then:

1. Create a new app
2. Head over to the **API Keys** section and note the **Auth Key**, **App ID** & **Region**

<Note>
  Minimum Requirement For Calling

  * Android API level 24 and above
  * iOS version 12 and above
</Note>

### Add the CometChatCalls Dependency

1. Add the following code in your `pubspec.yaml` file and run `pub get` command.

<Tabs>
  <Tab title="Dart">
    ```dart theme={null}
      cometchat_calls_sdk: ^4.2.2
    ```
  </Tab>
</Tabs>

2. Import CometChatCalls using following code in dart

<Tabs>
  <Tab title="Dart">
    ```dart theme={null}
    import 'package:cometchat_calls_sdk/cometchat_calls_sdk.dart';  
    ```
  </Tab>
</Tabs>

## Initialise CometChatCalls

The `init()` method initialises the settings required for CometChatCalls. The `init()` method takes the below parameters:

1. callAppSettings - An object of the CallAppSettings class can be created using the CallAppSettingBuilder class. The appId and region field is mandatory and can be set using the `setAppId()` and `setRegion()` method.

The `CallAppSettings` class allows you to configure three settings:

* **App ID**: CometChat app ID.
* **Region**: The region where you app was created.
* **Host(host: 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.

We suggest you call the `init()` method on activity `onCreate()` method.

<Tabs>
  <Tab title="Dart">
    ```dart theme={null}
    CallAppSettings callAppSettings= (CallAppSettingBuilder()
    ..appId = "xxxxxxxxxx"
    ..region= "xxxxxxxxxx"
      //..host = "xxxxxxxxx"
    ).build();
    CometChatCalls.init(callAppSettings, onSuccess: (String successMessage) {
    debugPrint("Initialization completed successfully  $successMessage");
    }, onError: (CometChatCallsException e) {
    debugPrint("Initialization failed with exception: ${e.message}");
    });
    ```
  </Tab>
</Tabs>

| Parameter         | Description                            |
| ----------------- | -------------------------------------- |
| `callAppSettings` | An object of the CallAppSettings class |
