{"id":22082938,"url":"https://github.com/countly/countly-sdk-flutter-bridge","last_synced_at":"2025-11-20T09:03:59.044Z","repository":{"id":38308892,"uuid":"209515495","full_name":"Countly/countly-sdk-flutter-bridge","owner":"Countly","description":"Flutter SDK for Countly Product Analytics Platform","archived":false,"fork":false,"pushed_at":"2024-04-19T08:15:32.000Z","size":3324,"stargazers_count":29,"open_issues_count":2,"forks_count":19,"subscribers_count":9,"default_branch":"master","last_synced_at":"2024-04-19T09:29:02.235Z","etag":null,"topics":["dart","flutter","flutter-analytics","flutter-apps","flutter-package","flutter-sdk"],"latest_commit_sha":null,"homepage":"https://count.ly","language":"Objective-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/Countly.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":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2019-09-19T09:34:24.000Z","updated_at":"2024-04-19T09:29:06.516Z","dependencies_parsed_at":"2023-02-19T08:16:10.874Z","dependency_job_id":"d1751617-5581-4fe1-9d0e-99223cbe1040","html_url":"https://github.com/Countly/countly-sdk-flutter-bridge","commit_stats":null,"previous_names":[],"tags_count":56,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Countly%2Fcountly-sdk-flutter-bridge","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Countly%2Fcountly-sdk-flutter-bridge/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Countly%2Fcountly-sdk-flutter-bridge/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Countly%2Fcountly-sdk-flutter-bridge/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Countly","download_url":"https://codeload.github.com/Countly/countly-sdk-flutter-bridge/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":227456482,"owners_count":17777940,"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":["dart","flutter","flutter-analytics","flutter-apps","flutter-package","flutter-sdk"],"created_at":"2024-12-01T00:08:21.184Z","updated_at":"2025-11-20T09:03:59.014Z","avatar_url":"https://github.com/Countly.png","language":"Objective-C","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Codacy Badge](https://app.codacy.com/project/badge/Grade/7ab95afb3da8421ab499cc921e1381ac)](https://app.codacy.com/gh/Countly/countly-sdk-flutter-bridge/dashboard?utm_source=gh\u0026utm_medium=referral\u0026utm_content=\u0026utm_campaign=Badge_grade)\n\n# Countly Flutter SDK\n\nThis repository contains the Countly Flutter SDK, which can be integrated into mobile Flutter applications. The Countly Flutter SDK is intended to be used with [Countly Lite](https://countly.com/lite), [Countly Flex](https://countly.com/flex), [Countly Enterprise](https://countly.com/enterprise).\n\n## What is Countly?\n[Countly](https://countly.com) is a product analytics solution and innovation enabler that helps teams track product performance and customer journey and behavior across [mobile](https://countly.com/mobile-analytics), [web](https://countly.com/web-analytics),\nand [desktop](https://countly.com/desktop-analytics) applications. [Ensuring privacy by design](https://countly.com/privacy-by-design), Countly allows you to innovate and enhance your products to provide personalized and customized customer experiences, and meet key business and revenue goals.\n\nTrack, measure, and take action - all without leaving Countly.\n\n* **Questions or feature requests?** [Join the Countly Community on Discord](https://discord.gg/countly)\n* **Looking for the Countly Server?** [Countly Server repository](https://github.com/Countly/countly-server)\n* **Looking for other Countly SDKs?** [An overview of all Countly SDKs for mobile, web and desktop](https://support.count.ly/hc/en-us/articles/360037236571-Downloading-and-Installing-SDKs#h_01H9QCP8G5Y9PZJGERZ4XWYDY9)\n\n## Integrating Countly SDK in your projects\n\nFor a detailed description on how to use this SDK [check out our documentation](https://support.count.ly/hc/en-us/articles/360037944212-Flutter).\n\nFor information about how to add the SDK to your project, please check [this section of the documentation](https://support.count.ly/hc/en-us/articles/360037944212-Flutter#h_01H930GAQ59MD94NK0NP68GNGT).\n\nYou can find minimal SDK integration information for your project in [this section of the documentation](https://support.count.ly/hc/en-us/articles/360037944212-Flutter#h_01H930GAQ5RGKSA3CTNVTBTDZF).\n\nFor an example integration of this SDK, you can have a look [here](https://github.com/Countly/countly-sdk-flutter-bridge/tree/master/example).\n\nThis SDK supports the following features:\n* [Analytics](https://support.count.ly/hc/en-us/articles/4431589003545-Analytics)\n* [Push Notifications](https://support.count.ly/hc/en-us/articles/4405405459225-Push-Notifications)\n* [User Profiles](https://support.count.ly/hc/en-us/articles/4403281285913-User-Profiles)\n* [Crash Reports](https://support.count.ly/hc/en-us/articles/4404213566105-Crashes-Errors)\n* [A/B Testing](https://support.count.ly/hc/en-us/articles/4416496362393-A-B-Testing-)\n* [Performance Monitoring](https://support.count.ly/hc/en-us/articles/4734457847705-Performance)\n* [Feedback Widgets](https://support.count.ly/hc/en-us/articles/4652903481753-Feedback-Surveys-NPS-and-Ratings-)\n\n## Installation\n\nIn the `dependencies:` section of your `pubspec.yaml`, add the following line:\n\n```yaml\ndependencies:\n  countly_flutter: \u003clatest_version\u003e\n```\n\n## Usage\n\n```dart\nimport 'package:countly_flutter/countly_flutter.dart';\n\nvoid main() {\n  runApp(MaterialApp(home: const MyApp()));\n}\n\nclass MyApp extends StatefulWidget {\n  const MyApp({Key? key}) : super(key: key);\n\n  @override\n  State\u003cMyApp\u003e createState() =\u003e _MyAppState();\n}\n\nclass _MyAppState extends State\u003cMyApp\u003e {\n  @override\n  void initState() {\n    super.initState();\n\n    // Initialize the SDK once\n    Countly.isInitialized().then((bool isInitialized) {\n      if (!isInitialized) {\n        // Create the configuration with your app key and server URL\n        final CountlyConfig config = CountlyConfig(SERVER_URL, APP_KEY)..setLoggingEnabled(true);\n        // In this example, we have logging enabled. For production, disable this.\n\n        // Initialize with that configuration\n        Countly.initWithConfig(config).then((value) {\n            Countly.start(); // Enables automatic view tracking\n        });\n      }\n    });\n  }\n\n  @override\n  Widget build(BuildContext context) {\n    return Scaffold(\n      appBar: AppBar(title: Text('Countly Example App')),\n      body: Center(\n        child: TextButton(\n          onPressed: () {\n            // record an event\n            Countly.recordEvent({'key': 'Basic Event', 'count': 1});\n          },\n          child: Text('Record Event'),\n        ),\n      ),\n    );\n  }\n}\n```\n\n## Enabling Automatic Crash Handling\n\n```dart\n// This will automatically catch all errors that are thrown from within the Flutter framework.\nfinal CountlyConfig config = CountlyConfig(SERVER_URL, APP_KEY)\n  ..enableCrashReporting()\nCountly.initWithConfig(config);\n```\n\n## Reporting Exceptions manually\n\n```dart\n// Manually report a handled or unhandled exception/error to Countly\nCountly.logException('This is a manually created exception', true, null);\n```\n\n## Recording Events\n\n```dart\n// Record events (User interactions)\n\nfinal event = {'key': 'Basic Event', 'count': 1};\nCountly.recordEvent({'key': 'Basic Event', 'count': 1});\n\n// you can also record events with segmentation\nevent['segmentation'] = {'Country': 'Turkey', 'Age': '28'};\nCountly.recordEvent({'key': 'Basic Event', 'count': 1});\n```\n\n## Recording Views\n\n```dart\n// Record screen views\n\nfinal segmentation = {'Country': 'Turkey', 'Age': '28'};\n\n// start recording view with segmentation. NB: Segmentation values are optional.\nfinal String? id = await Countly.instance.views.startView('HomePage', segmentation);\n\n// stop recording view with name with segmentation\nawait Countly.instance.views.stopViewWithName('HomePage', segmentation);\n\n// stop recording view with ID with segmentation\nawait Countly.instance.views.stopViewWithID(id, segmentation);\n\n// stop recording all views with segmentation\nawait Countly.instance.views.stopAllViews(segmentation);\n```\n\n## Change Device ID\n\n```dart\n// A device ID is a unique identifier for your users/device.\n\n// Change device ID with merge.\n// Here, the data associated with the previous device ID is merged with the new ID.\nawait Countly.instance.deviceId.changeWithMerge('123456');\n\n// Change device ID without merge.\n// Here, the new device ID is counted as a new device.\nawait Countly.instance.deviceId.changeWithoutMerge('123456');\n```\n\n## Get Device ID Type\n\n```dart\n// To fetch the device ID type\nfinal DeviceIdType? deviceIdtype = await Countly.instance.deviceId.getIDType();\n// DeviceIdType: DEVELOPER_SUPPLIED, SDK_GENERATED, TEMPORARY_ID\n```\n\n## User Profile\n\n```dart\n// To provide information regarding the current user, use this.\n\nfinal Map\u003cString, Object\u003e options = {\n  'name': 'Name of User',\n  'username': 'Username',\n  'email': 'User Email',\n  'phone': 'User Contact number',\n  'gender': 'User Gender',\n};\nCountly.instance.userProfile.setUserProperties(options);\n\n// Increment custom property value by 1\nCountly.instance.userProfile.increment('increment');\n\n// Increment custom property value by 10\nCountly.instance.userProfile.incrementBy('incrementBy', 10);\n\n// Multiply custom property value by 20\nCountly.instance.userProfile.multiply('multiply', 20);\n\n// Save max value between current value and provided value\nCountly.instance.userProfile.saveMax('saveMax', 100);\n\n// Save min value between current value and provided value\nCountly.instance.userProfile.saveMin('saveMin', 50);\n\n// Set custom property value if it doesn't exist\nCountly.instance.userProfile.setOnce('setOnce', '200');\n\n// Add unique value to custom property array\nCountly.instance.userProfile.pushUnique('pushUniqueValue', 'morning');\n\n// Add unique value to custom property array if it does not exist\nCountly.instance.userProfile.push('pushValue', 'morning');\n\n// Remove value from custom property array\nCountly.instance.userProfile.pull('pushValue', 'morning');\n\n// Send/Save provided values to server. After setting values, you must save it by calling save();\nCountly.instance.userProfile.save();\n\n// Clear queued operations / modifications\nCountly.instance.userProfile.clear();\n```\n\n## Consent\n\n```dart\n// For compatibility with data protection regulations, such as GDPR, the Countly\n// Flutter SDK allows developers to enable/disable any feature at any time depending\n// on user consent.\n\n// Consent values: sessions, events, views, location, crashes, attribution, users, push, starRating, apm, feedback, remoteConfig\n\n// Consent can be enabled during initialization\nfinal CountlyConfig config = CountlyConfig(SERVER_URL, APP_KEY)\n  ..setConsentEnabled([CountlyConsent.sessions]);\nCountly.initWithConfig(config);\n\n// Or after initialization using one of the below methods\n// give multiple consent\nCountly.giveConsent([CountlyConsent.events, CountlyConsent.views, CountlyConsent.crashes]);\n\n// remove multiple consent\nCountly.removeConsent([CountlyConsent.events, CountlyConsent.views, CountlyConsent.crashes]);\n\n// give all consent\nCountly.giveAllConsent();\n\n// remove all consent\nCountly.removeAllConsent();\n```\n\n## Acknowledgements\n\nFrom 2014 to 2020 it was maintained by Trinisoft Technologies developers (trinisofttechnologies@gmail.com).\n\n## Security\nSecurity is very important to us. If you discover any issue regarding security, please disclose the information responsibly by sending an email to security@count.ly and **not by creating a GitHub issue**.\n\n## Badges\nIf you like Countly, [why not use one of our badges](https://countly.com/brand-assets) and give a link back to us so others know about this wonderful platform?\n\n\u003ca href=\"https://count.ly/f/badge\" rel=\"nofollow\"\u003e\u003cimg style=\"width:145px;height:60px\" src=\"https://countly.com/badges/dark.svg?v2\" alt=\"Countly - Product Analytics\" /\u003e\u003c/a\u003e\n\n```JS\n\u003ca href=\"https://count.ly/f/badge\" rel=\"nofollow\"\u003e\u003cimg style=\"width:145px;height:60px\" src=\"https://countly.com/badges/dark.svg\" alt=\"Countly - Product Analytics\" /\u003e\u003c/a\u003e\n```\n\n\u003ca href=\"https://count.ly/f/badge\" rel=\"nofollow\"\u003e\u003cimg style=\"width:145px;height:60px\" src=\"https://countly.com/badges/light.svg?v2\" alt=\"Countly - Product Analytics\" /\u003e\u003c/a\u003e\n\n```JS\n\u003ca href=\"https://count.ly/f/badge\" rel=\"nofollow\"\u003e\u003cimg style=\"width:145px;height:60px\" src=\"https://countly.com/badges/light.svg\" alt=\"Countly - Product Analytics\" /\u003e\u003c/a\u003e\n```\n\n## How can I help you with your efforts?\nGlad you asked! For community support, feature requests, and engaging with the Countly Community, please join us at [our Discord Server](https://discord.gg/countly). We're excited to have you there!\n\nAlso, we are on [Twitter](https://twitter.com/gocountly) and [LinkedIn](https://www.linkedin.com/company/countly) if you would like to keep up with Countly related updates.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcountly%2Fcountly-sdk-flutter-bridge","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcountly%2Fcountly-sdk-flutter-bridge","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcountly%2Fcountly-sdk-flutter-bridge/lists"}