Search packages, repositories and app categories

GitHub repositoryaptabase/aptabase_flutter

aptabase_flutter

Flutter SDK for Aptabase: Open Source Privacy-First and Simple Analytics for Mobile, Desktop and Web Apps

aptabase_flutter project cover
Stars
27
Forks
20
Last push (UTC)
Jul 23, 2026
Project status
Active

Original README

English project snapshot. Visit GitHub for the latest content.

Aptabase

aptabase_flutter

pub package pub points

Instrument your app with Aptabase, an Open Source, Privacy-First, and Simple Analytics for Mobile, Desktop, and Web Apps.

Platform Support

Android iOS MacOS Web Linux Windows
✔️ ✔️ ✔️ ✔️ ✔️ ✔️

Install

You can install the SDK by running the following command:

flutter pub add aptabase_flutter

Android Requirements

If you're targeting Android, you'll need to add the following permissions to your AndroidManifest.xml:

<uses-permission android:name="android.permission.INTERNET" />

Usage

First, you need to get your App Key from Aptabase, you can find it in the Instructions menu on the left side menu.

On your main.dart, import package:aptabase_flutter/aptabase_flutter.dart and initialized the SDK.

void main() async {
+ WidgetsFlutterBinding.ensureInitialized();
+ await Aptabase.init("<YOUR_APP_KEY>"); // 👈 this is where you enter your App Key

  runApp(const MyApp());
}

Note: You need to change your main function to be async and call WidgetsFlutterBinding.ensureInitialized(); before initializing the SDK.

Afterward, you can start tracking events with Aptabase.instance anywhere in your Dart. Here's an example:

import 'package:aptabase_flutter/aptabase_flutter.dart';

class _CounterState extends State<Counter> {
  int _counter = 0;

  // Tracking how many times the user has clicked the button, alongside the current counter value
  void _incrementCounter() {
    Aptabase.instance.trackEvent("increment", { "counter": _counter });
    
    setState(() {
      _counter++;
    });
  }
}

A few important notes:

  1. The SDK will automatically enhance the event with some useful information, like the OS, the app version, and other things.
  2. You're in control of what gets sent to Aptabase. This SDK does not automatically track any events, you need to call trackEvent manually.
    • Because of this, it's generally recommended to at least track an event at startup
  3. You do not need to await for the trackEvent function, it'll run in the background.
  4. Only strings and numbers values are allowed on custom properties

Preparing for Submission to Apple App Store

When submitting your app to the Apple App Store, you'll need to fill out the App Privacy form. You can find all the answers on our How to fill out the Apple App Privacy when using Aptabase guide.

For AI/LLM integration instructions, see llms.txt

Aptabase GitHub avatar
GitHub author

Aptabase ↗

Open Source, Privacy-First and Simple Analytics for Mobile, Desktop and Web Apps

LanguagesDartC++CMakeSwiftHTMLCKotlinObjective-C

Categories

Packages published by this repository

Dependencies used

Dependency list 7 items

How do I choose a repository?

Start with your use case, compare repository activity, and check the original project before adopting it.

  1. Search by repository name, owner or description, then narrow the results by topic.
  2. Compare stars, forks and recent pushes. Stars show community interest, not a guarantee of quality.
  3. Read the README, license and issues on GitHub before using a project.

Sources and maintenance

“A repository is the most basic element of GitHub.”

GitHub Docs — About repositories ↗