{"id":21838403,"url":"https://github.com/aptabase/aptabase_flutter","last_synced_at":"2025-04-14T10:32:35.598Z","repository":{"id":148711648,"uuid":"620711082","full_name":"aptabase/aptabase_flutter","owner":"aptabase","description":"Flutter SDK for Aptabase: Open Source Privacy-First and Simple Analytics for Mobile, Desktop and Web Apps","archived":false,"fork":false,"pushed_at":"2024-12-18T07:09:28.000Z","size":351,"stargazers_count":21,"open_issues_count":1,"forks_count":11,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-27T23:41:48.491Z","etag":null,"topics":["analytics","dart","flutter","flutter-plugin","privacy"],"latest_commit_sha":null,"homepage":"https://aptabase.com","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/aptabase.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-03-29T08:16:06.000Z","updated_at":"2025-02-14T22:32:42.000Z","dependencies_parsed_at":null,"dependency_job_id":"441a8426-bbbf-470d-87dd-a889d24d260d","html_url":"https://github.com/aptabase/aptabase_flutter","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aptabase%2Faptabase_flutter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aptabase%2Faptabase_flutter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aptabase%2Faptabase_flutter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aptabase%2Faptabase_flutter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/aptabase","download_url":"https://codeload.github.com/aptabase/aptabase_flutter/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248862534,"owners_count":21173829,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["analytics","dart","flutter","flutter-plugin","privacy"],"created_at":"2024-11-27T21:10:56.134Z","updated_at":"2025-04-14T10:32:35.593Z","avatar_url":"https://github.com/aptabase.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"![Aptabase](https://aptabase.com/og.png)\n\n# aptabase_flutter\n\n[![pub package](https://img.shields.io/pub/v/aptabase_flutter.svg)](https://pub.dev/packages/aptabase_flutter)\n[![pub points](https://img.shields.io/pub/points/aptabase_flutter?color=2E8B57\u0026label=pub%20points)](https://pub.dev/packages/aptabase_flutter/score)\n\nInstrument your app with Aptabase, an Open Source, Privacy-First, and Simple Analytics for Mobile, Desktop, and Web Apps.\n\n## Platform Support\n\n| Android | iOS | MacOS | Web | Linux | Windows |\n| :-----: | :-: | :---: | :-: | :---: | :-----: |\n|   ✔️    | ✔️  |  ✔️   | ✔️  |  ✔️   |   ✔️    |\n\n## Install\n\nYou can install the SDK by running the following command:\n\n```shell\nflutter pub add aptabase_flutter\n```\n\n## Android Requirements\n\nIf you're targeting Android, you'll need to add the following permissions to your `AndroidManifest.xml`:\n\n```xml\n\u003cuses-permission android:name=\"android.permission.INTERNET\" /\u003e\n```\n\n## Usage\n\nFirst, you need to get your `App Key` from Aptabase, you can find it in the `Instructions` menu on the left side menu.\n\nOn your `main.dart`, import `package:aptabase_flutter/aptabase_flutter.dart` and initialized the SDK.\n\n```diff\nvoid main() async {\n+ WidgetsFlutterBinding.ensureInitialized();\n+ await Aptabase.init(\"\u003cYOUR_APP_KEY\u003e\"); // 👈 this is where you enter your App Key\n\n  runApp(const MyApp());\n}\n```\n\n`Note:` You need to change your main function to be `async` and call `WidgetsFlutterBinding.ensureInitialized();` before initializing the SDK.\n\nAfterward, you can start tracking events with `Aptabase.instance` anywhere in your Dart. Here's an example:\n\n```dart\nimport 'package:aptabase_flutter/aptabase_flutter.dart';\n\nclass _CounterState extends State\u003cCounter\u003e {\n  int _counter = 0;\n\n  // Tracking how many times the user has clicked the button, alongside the current counter value\n  void _incrementCounter() {\n    Aptabase.instance.trackEvent(\"increment\", { \"counter\": _counter });\n    \n    setState(() {\n      _counter++;\n    });\n  }\n}\n```\n\nA few important notes:\n\n1. The SDK will automatically enhance the event with some useful information, like the OS, the app version, and other things.\n2. You're in control of what gets sent to Aptabase. This SDK does not automatically track any events, you need to call `trackEvent` manually.\n    - Because of this, it's generally recommended to at least track an event at startup\n3. You do not need to await for the `trackEvent` function, it'll run in the background.\n3. Only strings and numbers values are allowed on custom properties\n\n## Preparing for Submission to Apple App Store\n\nWhen 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](https://aptabase.com/docs/apple-app-privacy) guide.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faptabase%2Faptabase_flutter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faptabase%2Faptabase_flutter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faptabase%2Faptabase_flutter/lists"}