# Get started with the Flutter SDK

Canonical page: https://docs.ovok.com/get-started/sdks/flutter

## Install [#install]

The SDK needs Dart 3.6 or later.

```bash
flutter pub add ovok_flutter
```

For a Dart-only app, run `dart pub add ovok_sdk` instead.

## Create a client [#create-a-client]

The client keeps the session in a secure store you provide. `OvokSecureStore` has the same `read`, `write` and `delete` methods as `flutter_secure_storage`, so an adapter only forwards them:

```dart
import 'package:flutter_secure_storage/flutter_secure_storage.dart';
import 'package:ovok_flutter/ovok_flutter.dart';

class SecureStore implements OvokSecureStore {
  SecureStore(this._storage);

  final FlutterSecureStorage _storage;

  @override
  Future<String?> read({required String key}) => _storage.read(key: key);

  @override
  Future<void> write({required String key, required String value}) =>
      _storage.write(key: key, value: value);

  @override
  Future<void> delete({required String key}) => _storage.delete(key: key);
}

final ovok = Ovok(
  baseUrl: 'https://api.sandbox.ovok.com',
  tenantCode: 'your-tenant',
  secureStore: SecureStore(const FlutterSecureStorage()),
);
```

## Sign in [#sign-in]

```dart
final result = await ovok.auth.login(
  profileType: ProfileType.practitioner,
  email: 'ada@example.com',
  password: password,
);

if (result case MfaRequired(:final challenge)) {
  await ovok.auth.verifyMfa(challenge, codeFromAuthenticatorApp);
}
```

## Make a first request [#make-a-first-request]

```dart
final patient = await ovok.fhir.read('Patient', 'patient-id');
```

Next: [full Flutter SDK docs](/flutter-sdk).
