A Kotlin Multiplatform (KMP) client for Appwrite, enabling seamless integration with Appwrite's backend services in your KMP projects. This client is designed to work with Android, iOS, and other platforms supported by Kotlin Multiplatform.
Note: This repository is truly inspired by the Appwrite Android SDK. Every function in this client mirrors the Android SDK to maintain consistency and ease of use.
- Full Appwrite Support: Integrate with all Appwrite services.
- Cross-Platform: Easily use the client across Android, iOS, and other platforms.
- Consistent API: Every function mirrors the Appwrite Android SDK for ease of use.
- A working Kotlin Multiplatform project.
- Android Studio for Android development.
- Xcode for iOS development.
- An Appwrite project with the necessary configurations.
Include the Appwrite KMP client dependency in your shared code. Add the following line to your CommonMain/build.gradle.kts:
implementation("com.jamshedalamqaderi.kmp:appwrite:<LATEST_VERSION>")-
Update AndroidManifest.xml
Add the following snippet inside the
<application>tag of yourAndroidManifest.xmlfile:<activity android:name="com.jamshedalamqaderi.kmp.appwrite.views.CallbackActivity" android:exported="true"> <intent-filter android:label="android_web_auth"> <action android:name="android.intent.action.VIEW" /> <category android:name="android.intent.category.DEFAULT" /> <category android:name="android.intent.category.BROWSABLE" /> <data android:scheme="appwrite-callback-[project-id]" /> </intent-filter> </activity>
Replace
[project-id]with your actual Appwrite project ID. -
Register Activity Lifecycle Callbacks
In your
MainActivity.kt, add the following line to register theAppwriteActivityLifecycleCallbacks:registerActivityLifecycleCallbacks(AppwriteActivityLifecycleCallbacks)
Modify your info.plist to handle Appwrite callbacks by adding the following:
<key>CFBundleURLTypes</key>
<array>
<dict>
<key>CFBundleTypeRole</key>
<string>Editor</string>
<key>CFBundleURLName</key>
<string>io.appwrite</string>
<key>CFBundleURLSchemes</key>
<array>
<string>appwrite-callback-[project-id]</string>
</array>
</dict>
</array>Replace [project-id] with your actual Appwrite project ID.
To initialize the Appwrite client in your project, use the following code snippet:
val client = Client()
.setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Replace with your API Endpoint
.setProject("5df5acd0d48c2") // Replace with your Appwrite project ID
.setSelfSigned(true) // Remove this in production if using self-signed certificates- OAuth2 Browser-Based Login on Desktop: Currently, OAuth2 browser-based login does not work on desktop platforms. It is supported only on Android, iOS, and web.
We welcome contributions from the community! To contribute:
- Fork the repository.
- Create a new branch for your feature or bug fix.
- Commit your changes with clear commit messages.
- Open a pull request against the
mainbranch.
Please ensure your code adheres to the project's coding standards and includes relevant tests.
For more detailed documentation, visit the Appwrite Official Documentation.
This project is licensed under the Apache License, Version 2.0. See the LICENSE file for full details.
Copyright 2025 Jamshed Alam Qaderi
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.