Installation
Add the Koolbase SDK to your Flutter project and get auth, database, semantic search, storage, realtime, functions, feature flags, code push, analytics, and cloud messaging in one package.
Not using Flutter? This page covers the Flutter SDK. For React Native (@koolbase/react-native) see the React Native SDK guide; for the browser (@koolbase/js) see the Web SDK guide.
Requirements
Install the SDK
Add the Koolbase SDK to your pubspec.yaml:
dependencies:
flutter:
sdk: flutter
koolbase_flutter: ^12.14.0Or install via the command line:
flutter pub add koolbase_flutterThen fetch dependencies:
flutter pub getWhat's Included
The koolbase_flutter package includes the full platform in one dependency:
Koolbase.authRegister, login, sessions, OAuth (Google + Apple), and phone + OTPKoolbase.dbJSONB collections, CRUD, access rules, realtime, populate, semantic search (auto-embed via Gemini or OpenAI), and offline cacheKoolbase.storageFile upload, download, and delete via Cloudflare R2Koolbase.realtimeWebSocket subscriptions for live data updatesKoolbase.functionsInvoke and deploy serverless functions (Deno + Dart runtimes)Koolbase.flagsFeature flags with percentage rollouts and targetingKoolbase.configRemote config values updated without app releasesKoolbase.versionForce or soft-prompt users to update the appKoolbase.analyticsEvents, screen views, DAU/WAU/MAU, funnels, and retentionKoolbase.messagingFCM push notifications — register tokens, receive, and handleKoolbase.codePushCode push — config + flag overrides, directives, SDUI, and mandatory updates, no store releaseKoolbaseAuthGate / KoolbaseCollectionListBehavioral widgets — auth branching and stale-while-revalidate lists, correct by construction (v10.3.0+)Android Setup
Add internet permission to your AndroidManifest.xml:
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
<uses-permission android:name="android.permission.INTERNET" />
...
</manifest>Ensure your minSdkVersion is at least 21:
android {
defaultConfig {
minSdkVersion 21
...
}
}Web Setup
The SDK runs in the browser from 12.0.0. Two steps, once:
flutter create . --platforms web
flutter run -d chrome --web-port 8080 --dart-define=KOOLBASE_PUBLIC_KEY=pk_live_...Then add the origin your app is served from — http://localhost:8080 in development, your domain in production — under Configuration → Trusted Origins in the dashboard. Without it the browser refuses every request to the API.
Code push and offline sync are not available on the web; auth, database, storage, realtime and functions are. Check Koolbase.isCodePushAvailable rather than branching on kIsWeb.
iOS Setup
No additional configuration required for the core SDK. Koolbase works out of the box on iOS 13+. Ensure your deployment target is set to iOS 13.0 or higher in Xcode.
Internal Dependencies
The Koolbase SDK manages these dependencies automatically:
httpDefault API transport (injectable — swap in your own client)web_socket_channelRealtime WebSocket subscriptionsshared_preferencesLocal caching of flags and configflutter_secure_storageDefault secure session storage (pluggable)package_info_plusApp version detection for version enforcementcryptoRollout bucketing and bundle signature verificationdriftOffline-first SQLite cacheconnectivity_plusAuto-sync of queued writes on network reconnectfirebase_messagingFCM cloud messagingVerify Installation
Confirm the SDK was installed correctly:
flutter pub deps | grep koolbase_flutterYou should see koolbase_flutter 12.0.0 (or newer) in the output.