---
title: Flutter SDK
description: Package raidboss_platform_sdk for Flutter / Dart clients.
---

# Flutter — `raidboss_platform_sdk`

## Install from Git (recommended for product apps)

```yaml
dependencies:
  raidboss_platform_sdk:
    git:
      url: https://github.com/ivanbalandin/RaidBossPlatform.git
      path: packages/raidboss_platform_sdk
      ref: main # or tag sdk-flutter-v0.1.3
```

Private repo (SSH):

```yaml
dependencies:
  raidboss_platform_sdk:
    git:
      url: git@github.com:ivanbalandin/RaidBossPlatform.git
      path: packages/raidboss_platform_sdk
      ref: main
```

```bash
flutter pub get
```

## Install from path (local monorepo)

```yaml
dependencies:
  raidboss_platform_sdk:
    path: ../RaidBossPlatform/packages/raidboss_platform_sdk
```

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

## Construct

```dart
final platform = RaidBossPlatformClient(
  apiUrl: 'YOUR_API_URL',
  applicationCode: 'YOUR_APP_CODE',
  publicKey: 'YOUR_PUBLIC_KEY',
  getAccessToken: () async => accessTokenOrNull,
);
```

## Methods

| Method | Auth | Public key | Notes |
| --- | --- | --- | --- |
| `getPaywall(paywallCode:)` | no | required | Default `main` |
| `registerUser(...)` | yes | — | After auth login |
| `registerDevice(...)` | yes | — | Stable `installationId` |
| `getMyEntitlements()` | yes | — | `EntitlementSnapshot` |
| `hasEntitlement(code)` | yes | — | Convenience |
| `createPayment(...)` | yes | required | Paid only |
| `activateLicenseKey(...)` | yes | — | Key redemption |
| `getConfig` / `getFeatures` | config: no / features: yes | — | Remote flags |
| `trackEvent(...)` | yes | — | Analytics |
| `PaywallData.isFreePrice(i)` | — | — | Free detection |

## Free price helper

```dart
if (paywall.isFreePrice(0)) {
  // local free tier — no createPayment
}
```

## Models

- `EntitlementSnapshot` — `codes`, `items`, `has(code)`, `activePlans`
- `PaywallData` — raw map + helpers
- `PaymentResult` — `paymentId`, `confirmationUrl`, amounts
- `RaidBossPlatformException` — `status`, `error`, `message`

Call `platform.close()` when disposing a long-lived client if you own the HTTP client lifecycle.
