> For the complete documentation index, see [llms.txt](https://flutter-nakama.gitbook.io/flutter-nakama/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://flutter-nakama.gitbook.io/flutter-nakama/installation-and-setup.md).

# Installation & Setup

## Prepare Nakama Dev environment

I suggest starting with Docker for your local dev environment. You find a tutorial in the official docs how to install Nakama: <https://heroiclabs.com/docs/install-docker-quickstart/>

## Install Flutter Nakama SDK

I assume you have basic knowledge about how to use flutter and dart. And you already have an existing project.

This package is available on [pub.dev](https://pub.dev/packages/nakama). Start over with adding `flutter_nakama` as a dependency to your project's `pubspec.yaml`:

```yaml
name: your_game
dependencies:
    flutter:
        sdk: flutter
    flutter_nakama: ^0.1.0
```

{% hint style="info" %}
This Package is available as **open source**. Please share your feedback by creating an issue on GitHub.
{% endhint %}

## Initialize base client

We handle all the magic hidden behind the package regarding cross platform support. While the communication with Nakama runs with a very high performance via [gRPC](https://grpc.io) but gRPC is not supported in web without using a proxy, it automatically uses HTTP(S) on web.

Initialize the SDK in an early point of your app with your host and serverKey. The serverKey is used if you are not yet authenticated as a user.

{% hint style="info" %}
The default value of **serverKey** is `defaultKey`! You can change this in [Nakama's config](https://heroiclabs.com/docs/install-configuration).
{% endhint %}

```dart
final client = getNakamaClient(
  host: '127.0.0.1',
  ssl: false,
  serverKey: 'defaultkey',
  grpcPort: 7349, // optional
  httpPort: 7350, // optional
);
```

### Singleton

You can obtain the client's singleton instance any time later via

```dart
final client = getNakamaClient();
```

But be sure to call it once with the required parameters `host`, `ssl` and `serverKey`.
