All Projects â†’ appwrite â†’ sdk-for-kotlin

appwrite / sdk-for-kotlin

Licence: BSD-3-Clause license
[READ-ONLY] Official Appwrite Kotlin SDK 💙🧡

Programming Languages

kotlin
9241 projects

Projects that are alternatives of or similar to sdk-for-kotlin

playground-for-android
Simple examples that help you get started with Appwrite + Android (=❤️)
Stars: ✭ 48 (+17.07%)
Mutual labels:  baas, appwrite
demos-for-svelte
Demos and tutorials for getting started with Appwrite + Svelte
Stars: ✭ 27 (-34.15%)
Mutual labels:  baas, appwrite
demos-for-vue
Demos and tutorials for getting started with Appwrite + Vue.js
Stars: ✭ 37 (-9.76%)
Mutual labels:  baas, appwrite
sdk-for-ruby
[READ-ONLY] Official Appwrite Ruby SDK 💎 🔴
Stars: ✭ 45 (+9.76%)
Mutual labels:  baas, appwrite
sdk-for-php
[READ-ONLY] Official Appwrite PHP SDK 🐘
Stars: ✭ 109 (+165.85%)
Mutual labels:  baas, appwrite
sdk-for-dart
[READ-ONLY] Official Appwrite Dart SDK 💙
Stars: ✭ 79 (+92.68%)
Mutual labels:  baas, appwrite
playground-for-node
Simple examples that help you get started with Appwrite + Node.js (=❤️)
Stars: ✭ 39 (-4.88%)
Mutual labels:  baas, appwrite
Appwrite
Appwrite is a secure end-to-end backend server for Web, Mobile, and Flutter developers that is packaged as a set of Docker containers for easy deployment 🚀
Stars: ✭ 14,592 (+35490.24%)
Mutual labels:  baas, appwrite
sdk-for-android
[READ-ONLY] Official Appwrite Android SDK 💚 🤖
Stars: ✭ 62 (+51.22%)
Mutual labels:  baas, appwrite
Xpmjs
微信小程序云端增强 SDK
Stars: ✭ 177 (+331.71%)
Mutual labels:  baas
FoodMagic
An AR App for Restaurants and Food Delivery ✨✨
Stars: ✭ 53 (+29.27%)
Mutual labels:  appwrite
Dv Php Core
Devless is a ready-made back-end for development of web or mobile applications. It is fully open source under the permissive Apache v2 license. This means that you can develop your front end without worrying about neither back-end code or the business risk of a proprietary backend-as-a-service.
Stars: ✭ 171 (+317.07%)
Mutual labels:  baas
Autoserver
Create a full-featured REST/GraphQL API from a configuration file
Stars: ✭ 188 (+358.54%)
Mutual labels:  baas
vbo365-rest
Unofficial Self-Service Web Portal for Veeam Backup for Microsoft Office 365
Stars: ✭ 44 (+7.32%)
Mutual labels:  baas
Space Cloud
Open source Firebase + Heroku to develop, scale and secure serverless apps on Kubernetes
Stars: ✭ 3,323 (+8004.88%)
Mutual labels:  baas
Sqler
write APIs using direct SQL queries with no hassle, let's rethink about SQL
Stars: ✭ 1,943 (+4639.02%)
Mutual labels:  baas
php-clamav
ClamAV network and pipe client for PHP
Stars: ✭ 45 (+9.76%)
Mutual labels:  appwrite
Orienteer
Business Application Platform
Stars: ✭ 128 (+212.2%)
Mutual labels:  baas
parse-hipaa
HIPAA & GDPR compliant ready parse-server with postgres/mongo, parse-hipaa-dashboard. Compatible with ParseCareKit
Stars: ✭ 74 (+80.49%)
Mutual labels:  baas
hoodie-notes
A Markdown notebook built with React and Hoodie
Stars: ✭ 17 (-58.54%)
Mutual labels:  baas

Appwrite Kotlin SDK

Maven Central License Version Twitter Account Discord

This SDK is compatible with Appwrite server version 0.15.x. For older versions, please check previous releases.

This is the Kotlin SDK for integrating with Appwrite from your Kotlin server-side code. If you're looking for the Android SDK you should check appwrite/sdk-for-android

Appwrite is an open-source backend as a service server that abstract and simplify complex and repetitive development tasks behind a very simple to use REST API. Appwrite aims to help you develop your apps faster and in a more secure way. Use the Kotlin SDK to integrate your app with the Appwrite server to easily start interacting with all of Appwrite backend APIs and tools. For full API documentation and tutorials go to https://appwrite.io/docs

Appwrite

Installation

Gradle

Appwrite's Kotlin SDK is hosted on Maven Central. In order to fetch the Appwrite SDK, add this to your root level build.gradle(.kts) file:

repositories {      
    mavenCentral()
}

If you would like to fetch our SNAPSHOT releases, you need to add the SNAPSHOT maven repository to your build.gradle(.kts):

repositories {
    maven {
        url "https://s01.oss.sonatype.org/content/repositories/snapshots/"
    }
}

Next, add the dependency to your project's build.gradle(.kts) file:

implementation("io.appwrite:sdk-for-kotlin:0.6.0")

Maven

Add this to your project's pom.xml file:

<dependencies>
    <dependency>
        <groupId>io.appwrite</groupId>
        <artifactId>sdk-for-kotlin</artifactId>
        <version>0.6.0</version>
    </dependency>
</dependencies>

Getting Started

Init your SDK

Initialize your SDK with your Appwrite server API endpoint and project ID which can be found in your project settings page and your new API secret Key project API keys section.

import io.appwrite.Client
import io.appwrite.services.Account

suspend fun main() {
    val client = Client(context)
      .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
      .setProject("5df5acd0d48c2") // Your project ID
      .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key
      .setSelfSigned(true) // Use only on dev mode with a self-signed SSL cert
}

Make Your First Request

Once your SDK object is set, create any of the Appwrite service objects and choose any request to send. Full documentation for any service method you would like to use can be found in your SDK documentation or in the API References section.

val users = Users(client)
val response = users.create(
    user = "[USER_ID]",
    email = "[email protected]",
    password = "password",
)
val json = response.body?.string()

Full Example

import io.appwrite.Client
import io.appwrite.services.Users

suspend fun main() {
    val client = Client(context)
      .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
      .setProject("5df5acd0d48c2") // Your project ID
      .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key
      .setSelfSigned(true) // Use only on dev mode with a self-signed SSL cert

    val users = Users(client)
    val response = users.create(
        user = "[USER_ID]",
        email = "[email protected]",
        password = "password",
    )
    val json = response.body?.string()
}

Error Handling

The Appwrite Kotlin SDK raises AppwriteException object with message, code and response properties. You can handle any errors by catching AppwriteException and present the message to the user or handle it yourself based on the provided error information. Below is an example.

import io.appwrite.Client
import io.appwrite.services.Users

suspend fun main() {
    val users = Users(client)
    try {
        val response = users.create(
            user = "[USER_ID]",
            email = "[email protected]",
            password = "password",
        )
        var jsonString = response.body?.string() ?: ""

    } catch (e: AppwriteException) {
        println(e)
    }
}

Learn more

You can use the following resources to learn more and get help

Contribution

This library is auto-generated by Appwrite custom SDK Generator. To learn more about how you can help us improve this SDK, please check the contribution guide before sending a pull-request.

License

Please see the BSD-3-Clause license file for more information.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].