This is the Anam AI Kotlin Multiplatform SDK. It's an experimental SDK (not official) to integrate Anam's digital personas into your product.
The Anam AI Kotlin Multiplatform SDK is designed to help developers integrate Anam AI's digital personas into their Kotlin Multiplatform applications. The SDK provides a set of APIs and utilities to make it easier to create, manage, and interact with digital personas in a realtime environment.
The project includes an example Multiplatform application that targets Android, iOS, and Web (wasmJs), built with Compose Multiplatform.
The SDK is available on Maven Central.
Add the dependency to your build.gradle.kts:
kotlin {
sourceSets {
commonMain.dependencies {
implementation("ai.anam:anam-kotlin-sdk:<version>")
}
}
}dependencies {
implementation "ai.anam:anam-kotlin-sdk-android:<version>"
}[libraries]
anam-sdk = { module = "ai.anam:anam-kotlin-sdk", version = "<version>" }Install all Homebrew dependencies at once using the included Brewfile:
brew bundleThis will install:
openjdk@21(Java Development Kit required for Gradle)kotlin(Kotlin compiler)swiftlint(Swift code linter for iOS)cocoapods(iOS dependency manager)
If you prefer to install dependencies manually:
# Java Development Kit (required for Gradle)
brew install openjdk@21
# Kotlin compiler (optional but recommended)
brew install kotlin
# SwiftLint (optional, for iOS code quality)
brew install swiftlint
# CocoaPods (required for iOS dependencies)
brew install cocoapodsAdditional Setup:
- Xcode Command Line Tools (required for iOS builds):
xcode-select --install
- Xcode: Install from the App Store (required for iOS development)
- Android SDK: Install via JetBrains Toolbox (recommended for better version management):
Then use Toolbox to install Android Studio. Alternatively, install Android SDK command line tools directly:
brew install --cask jetbrains-toolbox
brew install --cask android-commandlinetools
- Modern web browser (for Web/wasmJs): Chrome, Firefox, Safari, or Edge with WebAssembly support.
Anam/
├── apps/
│ ├── android/ # Android application entry point
│ ├── ios/ # iOS application entry point (SwiftUI)
│ └── web/ # Web application entry point (Compose for Web, wasmJs)
│
├── packages/
│ ├── app/ # Shared Compose Multiplatform UI module
│ │
│ ├── core/ # Core functionality modules
│ │ ├── coroutines/ # Coroutines utilities
│ │ ├── di/ # Dependency injection
│ │ ├── logging/ # Logging utilities
│ │ ├── navigation/ # Navigation components
│ │ ├── settings/ # Settings/preferences management
│ │ └── ui/ # UI components
│ │ ├── core/ # Core UI components
│ │ ├── resources/# Resources (fonts, images, etc.)
│ │ └── theme/ # Theme configuration
│ │
│ ├── feature/ # Feature modules
│ │ └── home/ # Home feature
│ │
│ └── sdk/ # SDK module for API clients
│
└── gradle/
└── build-logic/ # Custom Gradle conventions and plugins
In order to run the applications, you are required to:
-
Generate an API token via Anam Labs (or your Anam Labs instance)
-
Add the API token to your build configuration. You can do this in one of the following ways:
Option A: Add to
gradle.properties(recommended for team sharing):API_TOKEN=your_api_token_hereOption B: Add to
local.properties(recommended for local development, as this file is git-ignored):API_TOKEN=your_api_token_hereOption C: Pass via command line:
./gradlew :apps:android:assembleDebug -PAPI_TOKEN=your_api_token_here
The build system will check for the token in this order: Gradle properties →
local.properties→ defaults to empty string if not found.⚠️ Note: If you don't set the API token, the app will build but may not function correctly without a valid token.
# Build debug APK
./gradlew :apps:android:assembleDebug
# Install and run on connected device/emulator
./gradlew :apps:android:installDebugFirst-time setup:
-
Install CocoaPods dependencies (required for WebRTC SDK):
cd apps/ios pod installOr use the Gradle task:
./gradlew :packages:sdk:podInstall
-
Configure CocoaPods path (if building from Xcode):
If you get
ERROR: CocoaPods executable not found in your PATHwhen building in Xcode, add the CocoaPods path tolocal.properties:echo "kotlin.apple.cocoapods.bin=$(which pod)" >> local.properties
Or manually edit
local.propertiesand add:kotlin.apple.cocoapods.bin=/opt/homebrew/bin/pod(Adjust the path if CocoaPods is installed elsewhere)
-
Open the workspace (not the project) in Xcode:
open apps/ios/App.xcworkspace
⚠️ Important: Always openApp.xcworkspace, notApp.xcodeproj, when using CocoaPods.
Building:
# Build from command line (requires Xcode)
xcodebuild -workspace apps/ios/App.xcworkspace -scheme App -configuration DebugA modern web browser with WebAssembly support is required. No Xcode, CocoaPods, or Android SDK needed.
# Run development server (opens in browser)
./gradlew :apps:web:wasmJsBrowserDevelopmentRun
# Build production distribution (output in apps/web/build/dist/wasmJs/productionExecutable/)
./gradlew :apps:web:wasmJsBrowserDistributionThe API token from API Token Setup is read from gradle.properties or local.properties when running the web app.
- Kotlin: 2.2.21
- Compose Multiplatform: 1.10.0
- Gradle: 8.14.3
- Ktor: 3.3.3 (HTTP client)
