# Installation

We provide SDKs for developing projects in: NodeJS, Go, React Native (Android and iOS), Web projects, and Kotlin for Android.

## Obtaining Credentials

To obtain the necessary credentials for accessing the Sodot JFrog Artifactory repository, use our guide [here](/kotlin/credentials_guide).

## Minimum Requirements for Installation

* Android 7.0 (API level 24) or higher
* Kotlin 1.9 or higher
* Java 17 compatibility

## Android (Kotlin)

To use the Kotlin SDK in your Android project, follow these installation steps:

:::tip[Notice]
The *artifactoryPassword* parameter should be a token for the Sodot JFrog Artifactory repository
:::

<Tabs>
  <Tab title="Gradle (Groovy)">
    ### Gradle (Groovy)

    #### 1. Configure JFrog Artifactory Repository

    Add the Sodot Maven repository to your `settings.gradle` file:

    ```groovy
    // settings.gradle
    dependencyResolutionManagement {
        repositories {
            google()
            mavenCentral()
            maven {
                url "https://repo.sodot.dev/artifactory/sodot-kotlin-repo"
                credentials {
                    username = artifactoryUser ?: System.getenv('ARTIFACTORY_USER')
                    password = artifactoryPassword ?: System.getenv('ARTIFACTORY_PASSWORD')
                }
                metadataSources {
                    mavenPom()
                    artifact()
                }
            }
        }
    }
    ```

    #### 2. Configure Credentials

    Add your Artifactory credentials in your `gradle.properties` file:

    ```properties
    # ~/.gradle/gradle.properties or project's gradle.properties
    artifactoryUser=your_username
    artifactoryPassword=your_password
    ```

    Or set them as environment variables:

    ```bash
    export ARTIFACTORY_USER=your_username
    export ARTIFACTORY_PASSWORD=your_password
    ```

    #### 3. Add the Dependency

    In your module-level `build.gradle`, add the Sodot Kotlin SDK dependency:

    ```groovy
    dependencies {
        implementation "com.sodot:kotlin-sdk:<version>"
    }
    ```

    #### 4. Sync Project

    Sync your project with Gradle files to download the dependency.
  </Tab>

  <Tab title="Gradle (Kotlin DSL)">
    ### Gradle (Kotlin DSL)

    #### 1. Configure JFrog Artifactory Repository

    Add the Sodot Maven repository to your `settings.gradle.kts` file:

    ```kotlin
    // settings.gradle.kts
    dependencyResolutionManagement {
        repositories {
            google()
            mavenCentral()
            maven {
                url = uri("https://repo.sodot.dev/artifactory/sodot-kotlin-repo")
                credentials {
                    username = extra["artifactoryUser"]?.toString() ?: System.getenv("ARTIFACTORY_USER")
                    password = extra["artifactoryPassword"]?.toString() ?: System.getenv("ARTIFACTORY_PASSWORD")
                }
                metadataSources {
                    mavenPom()
                    artifact()
                }
            }
        }
    }
    ```

    #### 2. Configure Credentials

    Add your Artifactory credentials in your `gradle.properties` file:

    ```properties
    # ~/.gradle/gradle.properties or project's gradle.properties
    artifactoryUser=your_username
    artifactoryPassword=your_password
    ```

    Or set them as environment variables:

    ```bash
    export ARTIFACTORY_USER=your_username
    export ARTIFACTORY_PASSWORD=your_password
    ```

    #### 3. Add the Dependency

    In your module-level `build.gradle.kts`, add the Sodot Kotlin SDK dependency:

    ```kotlin
    dependencies {
        implementation("com.sodot:kotlin-sdk:<version>")
    }
    ```

    #### 4. Sync Project

    Sync your project with Gradle files to download the dependency.
  </Tab>

  <Tab title="React Native">
    ### React Native

    #### 1. Configure JFrog Artifactory Repository

    Add the Sodot Maven repository to your React Native Android project:

    ##### In `android/settings.gradle`

    ```groovy
    dependencyResolutionManagement {
        repositories {
            google()
            mavenCentral()
            maven {
                url "https://repo.sodot.dev/artifactory/sodot-kotlin-repo"
                credentials {
                    username = artifactoryUser ?: System.getenv('ARTIFACTORY_USER')
                    password = artifactoryPassword ?: System.getenv('ARTIFACTORY_PASSWORD')
                }
                metadataSources {
                    mavenPom()
                    artifact()
                }
            }
        }
    }
    ```

    #### 2. Configure Credentials

    Add your Artifactory credentials in `android/gradle.properties`:

    ```properties
    artifactoryUser=your_username
    artifactoryPassword=your_password
    ```

    Or set them as environment variables:

    ```bash
    export ARTIFACTORY_USER=your_username
    export ARTIFACTORY_PASSWORD=your_password
    ```

    #### 3. Add the Dependency

    In your React Native Android module's `build.gradle` (typically `android/app/build.gradle` or a custom module's `build.gradle`), add:

    ```groovy
    dependencies {
        // Other dependencies...
        implementation "com.sodot:kotlin-sdk:<version>@aar"
    }
    ```

    #### 4. Sync Project

    Run `./gradlew build` in the Android directory or sync via Android Studio to download the dependency.
  </Tab>
</Tabs>

## Permissions

Make sure to add internet permission to your `AndroidManifest.xml`:

```xml
<uses-permission android:name="android.permission.INTERNET" />
```

## ProGuard Rules

If you're using ProGuard for release builds, add the following rules to your `proguard-rules.pro` file to prevent the SDK from being obfuscated:

```
-keep class com.sodot.kotlin_sdk.** { *; }
```

## Usage

After installation, you can import the SDK classes in your Kotlin files:

```kotlin
import com.sodot.kotlin_sdk.Ecdsa
import com.sodot.kotlin_sdk.Ed25519
import com.sodot.kotlin_sdk.BIP340
import com.sodot.kotlin_sdk.Sr25519
import com.sodot.kotlin_sdk.ExportableEd25519
```

You can now start generating keys and signing. Refer to the [Getting Started](/kotlin/getting_started) guide for next steps.
