Announcing the Appwrite SDK for Dart
Tags: dart, appwrite, flutter
Published: 2021-03-12 06:42:09

We are extremely happy to announce the release of the Appwrite [SDK for Dart](https://github.com/appwrite/dart).

This SDK joins other SDKs, such as the Node, Deno and PHP server-side SDKs that allow you to extend your Appwrite functionality from your backend.

Note, this is a Dart server side SDK, if you are looking for Flutter integration, please checkout our [SDK for Flutter](https://github.com/appwrite/sdk-for-flutter) and the official [Playground for Flutter](https://github.com/appwrite/playground-for-flutter).

## What is Dart?
Made by Google, Dart is a client-optimized language for fast applications on any platform. Dart compiles to ARM & x64 machine code for mobile, desktop and backend. Or compile to JavaScript for the web. Dart is also one of the fastest growing languages.

## What Is Appwrite?
In case you’re new to [Appwrite](https://appwrite.io), Appwrite is a new open-source, end-to-end, backend server for front-end and mobile developers that allows you to build apps much faster. Its goal is to abstract and simplify common development tasks behind REST APIs and tools, helping you to build advanced apps faster.


## Getting Started

### Install Appwrite
The easiest way to start running your Appwrite server is by running our Docker installer tool from your terminal. Before running the installation command, make sure you have Docker CLI installed on your host machine.

Unix
```bash
docker run -it --rm \
    --volume /var/run/docker.sock:/var/run/docker.sock \
    --volume "$(pwd)"/appwrite:/usr/src/code/appwrite:rw \
    --entrypoint="install" \
    appwrite/appwrite:0.7.0
```

Windows (CMD)
```cmd
docker run -it --rm ^
    --volume //var/run/docker.sock:/var/run/docker.sock ^
    --volume "%cd%"/appwrite:/usr/src/code/appwrite:rw ^
    --entrypoint="install" ^
    appwrite/appwrite:0.7.0
```

Windows (PowerShell)
```powershell
docker run -it --rm ,
    --volume /var/run/docker.sock:/var/run/docker.sock ,
    --volume ${pwd}/appwrite:/usr/src/code/appwrite:rw ,
    --entrypoint="install" ,
    appwrite/appwrite:0.7.0
```

 

### Grab the Dart SDK

If you don't know Dart yet, you can find it [here](https://dart.dev/).

[Add Appwrite](https://github.com/appwrite/sdk-for-dart) SDK to your project’s **pubspec.yaml** file.
```yaml
dependencies:
  dart_appwrite: ^0.1.0
```
Then get the dependencies by running
```bash
dart pub get
```

### Initialize & Make API Request
Once you add the dependencies, its extremely easy to get started with the SDK; All you need to do is import the package in your code, set your Appwrite credentials, and start making API calls. Below is a simple example:

```dart
import 'package:dart_appwrite/dart_appwrite.dart';

void main() async {
  Client client = Client();
  .setEndpoint(
          'http://[HOSTNAME_OR_IP]/v1') // Make sure your endpoint is accessible
      .setProject('5ff3379a01d25') // Your project ID
      .setKey('cd868c7af8bdc893b4...93b7535db89')
  Users users = Users(client);
  final response = await users.create(email: ‘email@example.com’,password: ‘password’, name: ‘name’);
  print(response.data);
}
```

## Cloud Functions
Recently released Appwrite 0.7, has support for Dart cloud functions, and the Appwrite Dart SDK can be used to write cloud functions for Appwrite. To learn how to create and run Appwrite Functions with Dart, please head over to our [tutorial](https://dev.to/appwrite/learn-how-to-create-and-run-appwrite-functions-with-dart-5668). You can find samples for Dart cloud functions in Appwrite's [Github Repository](https://github.com/appwrite/demos-for-functions).

## Docs and Examples

To learn more about how to use the new Dart SDK, You can visit the [Getting Started With Server](https://appwrite.io/docs/getting-started-for-server) section on the official [Appwrite documentation](https://appwrite.io/docs) where you can select Dart in the code examples. We have also released a new dedicated [Dart Playground](https://github.com/appwrite/playground-for-dart) repository with useful code examples that can help you get a good look and feel for how you can use the new SDK for Appwrite.