Package raidboss_platform_sdk for Flutter / Dart clients.
Flutter — raidboss_platform_sdk
Install from Git (recommended for product apps)
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):
dependencies:
raidboss_platform_sdk:
git:
url: git@github.com:ivanbalandin/RaidBossPlatform.git
path: packages/raidboss_platform_sdk
ref: main
flutter pub get
Install from path (local monorepo)
dependencies:
raidboss_platform_sdk:
path: ../RaidBossPlatform/packages/raidboss_platform_sdk
import 'package:raidboss_platform_sdk/raidboss_platform_sdk.dart';
Construct
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; does not upgrade legal versions |
getMyConsents / acceptConsents | yes | — | Explicit accept of new versions |
updateUserProfile(...) | yes | — | After name/avatar change |
registerDevice(...) | yes | — | Stable UUID installationId → “Devices active” |
getMyEntitlements() | yes | — | EntitlementSnapshot |
hasEntitlement(code) | yes | — | Convenience |
createPayment(...) | yes | required | Paid only |
syncPayment(paymentId) | yes | — | After YooKassa return |
activateLicenseKey(...) | yes | — | Key redemption |
getConfig / getFeatures | config: no / features: yes | — | Remote flags |
getApplicationBranding() | no | required | App icon + website |
getBanner / listBanners | no | required | App HTML banners |
getSiteBanner / listSiteBanners | no | required | CMS site banners |
trackEvent(...) | yes | — | Analytics; with installationId+platform also heartbeats device |
PaywallData.isFreePrice(i) | — | — | Free detection |
Free price helper
if (paywall.isFreePrice(0)) {
// local free tier — no createPayment
}
Models
EntitlementSnapshot—codes,items,has(code),activePlansPaywallData— raw map + helpersPaymentResult—paymentId,confirmationUrl, amountsRaidBossPlatformException—status,error,message
Call platform.close() when disposing a long-lived client if you own the HTTP client lifecycle.