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

Flutter≥ 3.0.0
Dart≥ 3.0.0
iOS≥ 13.0
AndroidAPI 21+
Webany modern browser

Install the SDK

Add the Koolbase SDK to your pubspec.yaml:

pubspec.yaml
YAML
dependencies:
  flutter:
  sdk: flutter
  koolbase_flutter: ^12.14.0

Or install via the command line:

flutter pub add koolbase_flutter

Then fetch dependencies:

flutter pub get

What's Included

The koolbase_flutter package includes the full platform in one dependency:

Koolbase.authRegister, login, sessions, OAuth (Google + Apple), and phone + OTP
Koolbase.dbJSONB collections, CRUD, access rules, realtime, populate, semantic search (auto-embed via Gemini or OpenAI), and offline cache
Koolbase.storageFile upload, download, and delete via Cloudflare R2
Koolbase.realtimeWebSocket subscriptions for live data updates
Koolbase.functionsInvoke and deploy serverless functions (Deno + Dart runtimes)
Koolbase.flagsFeature flags with percentage rollouts and targeting
Koolbase.configRemote config values updated without app releases
Koolbase.versionForce or soft-prompt users to update the app
Koolbase.analyticsEvents, screen views, DAU/WAU/MAU, funnels, and retention
Koolbase.messagingFCM push notifications — register tokens, receive, and handle
Koolbase.codePushCode push — config + flag overrides, directives, SDUI, and mandatory updates, no store release
KoolbaseAuthGate / KoolbaseCollectionListBehavioral widgets — auth branching and stale-while-revalidate lists, correct by construction (v10.3.0+)

Android Setup

Add internet permission to your AndroidManifest.xml:

android/app/src/main/AndroidManifest.xml
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/app/build.gradle
Groovy
android {
    defaultConfig {
        minSdkVersion 21
        ...
    }
}

Web Setup

The SDK runs in the browser from 12.0.0. Two steps, once:

terminal
Bash
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 subscriptions
shared_preferencesLocal caching of flags and config
flutter_secure_storageDefault secure session storage (pluggable)
package_info_plusApp version detection for version enforcement
cryptoRollout bucketing and bundle signature verification
driftOffline-first SQLite cache
connectivity_plusAuto-sync of queued writes on network reconnect
firebase_messagingFCM cloud messaging

Verify Installation

Confirm the SDK was installed correctly:

flutter pub deps | grep koolbase_flutter

You should see koolbase_flutter 12.0.0 (or newer) in the output.