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.
Minimum Requirements for Installation
- Android 5.0 (API level 21) or higher
- Kotlin 1.6 or higher
- Java 8 compatibility
Android (Kotlin)
To use the Kotlin SDK in your Android project, follow these installation steps:
Notice: The artifactoryPassword parameter should be a token for the Sodot JFrog Artifactory repository
- Gradle (Groovy)
- Gradle (Kotlin DSL)
- React Native
Gradle (Groovy)
1. Configure JFrog Artifactory Repository
Add the Sodot Maven repository to your settings.gradle file:
// 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:
# ~/.gradle/gradle.properties or project's gradle.properties
artifactoryUser=your_username
artifactoryPassword=your_password
Or set them as environment variables:
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:
dependencies {
implementation "com.sodot:kotlin-sdk:<version>"
}
4. Sync Project
Sync your project with Gradle files to download the dependency.
Gradle (Kotlin DSL)
1. Configure JFrog Artifactory Repository
Add the Sodot Maven repository to your settings.gradle.kts file:
// 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:
# ~/.gradle/gradle.properties or project's gradle.properties
artifactoryUser=your_username
artifactoryPassword=your_password
Or set them as environment variables:
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:
dependencies {
implementation("com.sodot:kotlin-sdk:<version>")
}
4. Sync Project
Sync your project with Gradle files to download the dependency.
React Native
1. Configure JFrog Artifactory Repository
Add the Sodot Maven repository to your React Native Android project:
In android/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 android/gradle.properties:
artifactoryUser=your_username
artifactoryPassword=your_password
Or set them as environment variables:
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:
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.
Permissions
Make sure to add internet permission to your AndroidManifest.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:
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 guide for next steps.