The SurrealDB SDK for Kotlin is distributed through Maven Central under the com.surrealdb group. You can add it to your project using Gradle or Maven.
Note
Requirements
The SDK is a Kotlin Multiplatform library built with Kotlin 2.1.x. It supports the following targets:
| Target | Requirement |
|---|---|
| JVM | Java 11 or later |
| Android | minSdk 26 or later, Java 11 |
| iOS | iosX64, iosArm64, iosSimulatorArm64 |
It depends on Kotlin Coroutines, kotlinx.serialization, kotlinx.datetime, and Ktor for transport. Embedded (in-process) databases are intentionally not included in this release; connect to a running SurrealDB instance over WebSocket or HTTP instead.
Install the SDK
For a Kotlin Multiplatform project, add the metadata artifact com.surrealdb:kotlin to your commonMain source set. For a single-platform project, you may instead depend on the platform-specific variant (kotlin-jvm, kotlin-android, kotlin-iosarm64, kotlin-iossimulatorarm64, or kotlin-iosx64).
Note
Import the SDK
After installing, import the client from the com.surrealdb.kotlin package.
Next steps
Quickstart for a complete working example
Connecting to SurrealDB for connection options and protocols
Authentication for signing in and managing credentials