{"id":32270580,"url":"https://github.com/fastpix/flutter-core-data-sdk","last_synced_at":"2025-10-22T22:39:46.220Z","repository":{"id":312090274,"uuid":"1046221780","full_name":"FastPix/flutter-core-data-sdk","owner":"FastPix","description":"A comprehensive Flutter SDK for video player analytics and event tracking, designed to provide detailed insights into video playback behavior and user engagement metrics.","archived":false,"fork":false,"pushed_at":"2025-08-29T07:37:07.000Z","size":55,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-10-22T22:39:45.943Z","etag":null,"topics":["analyt","dart","data","flutter"],"latest_commit_sha":null,"homepage":"https://www.fastpix.io/","language":"Dart","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/FastPix.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,"zenodo":null}},"created_at":"2025-08-28T11:18:44.000Z","updated_at":"2025-08-29T07:37:10.000Z","dependencies_parsed_at":"2025-08-28T20:21:11.727Z","dependency_job_id":"f3d8b459-4b5e-44b2-9165-89bb249f6eb0","html_url":"https://github.com/FastPix/flutter-core-data-sdk","commit_stats":null,"previous_names":["fastpix/flutter-core-data-sdk"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/FastPix/flutter-core-data-sdk","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FastPix%2Fflutter-core-data-sdk","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FastPix%2Fflutter-core-data-sdk/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FastPix%2Fflutter-core-data-sdk/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FastPix%2Fflutter-core-data-sdk/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/FastPix","download_url":"https://codeload.github.com/FastPix/flutter-core-data-sdk/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FastPix%2Fflutter-core-data-sdk/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":280528608,"owners_count":26345642,"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","status":"online","status_checked_at":"2025-10-22T02:00:06.515Z","response_time":63,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["analyt","dart","data","flutter"],"created_at":"2025-10-22T22:39:43.221Z","updated_at":"2025-10-22T22:39:46.214Z","avatar_url":"https://github.com/FastPix.png","language":"Dart","readme":"# Flutter Core SDK\n\nA comprehensive Flutter SDK for video player analytics and event tracking, designed to provide detailed insights into video playback behavior and user engagement metrics.\n\n## Features\n\n- **Comprehensive Event Tracking**: Monitor all video player events including play, pause, seeking, buffering, and more\n- **Real-time Analytics**: Track view watch time, player state changes, and user engagement metrics\n- **Flexible Configuration**: Customizable workspace IDs, beacon URLs, and custom data fields\n- **Lifecycle Management**: Automatic app lifecycle handling and session management\n- **Cross-platform Support**: Works seamlessly on both iOS and Android platforms\n- **Performance Optimized**: Efficient event dispatching and state management\n- **Extensible Architecture**: Easy to extend with custom events and data models\n\n## Installation\n\nAdd the following dependency to your `pubspec.yaml`:\n\n```yaml\ndependencies:\n  flutter_core_sdk: ^1.0.2\n```\n\nThen run:\n\n```bash\nflutter pub get\n```\n\n## Quick Start\n\nHere's a minimal example to get you started:\n\n```dart\nimport 'package:fastpix_flutter_core_data/fastpix_flutter_core_data.dart';\n\nvoid main() {\n  // Configure the SDK\n  final metrics = FastPixMetrics.builder()\n    .setWorkSpaceId('your-workspace-id')\n    .setBeaconUrl('https://your-beacon-url.com')\n    .setViewerId('user-123')\n    .build();\n\n  // Track player events - only dispatch play event\n  // SDK automatically handles viewBegin and playerReady internally\n  metrics.dispatchEvent(PlayerEvent.play);\n}\n```\n\n## Usage / API Reference\n\n### Core Classes\n\n#### FastPixMetrics\nThe main entry point for the SDK. Handles event dispatching and configuration management.\n\n```dart\nclass FastPixMetrics {\n  // Dispatch player events\n  // Note: Only dispatch play event - SDK automatically handles viewBegin and playerReady\n  Future\u003cvoid\u003e dispatchEvent(PlayerEvent event, {Map\u003cString, String\u003e? attributes});\n  \n  // Get current player observer\n  PlayerObserver get playerObserver;\n}\n```\n\n#### MetricsConfiguration\nConfiguration class for setting up the SDK with required parameters.\n\n```dart\nclass MetricsConfiguration {\n  final PlayerData? playerData;\n  final String? workspaceId;\n  final String? beaconUrl;\n  final String? viewerId;\n  final VideoData? videoData;\n  final bool enableLogging;\n  final List\u003cCustomData\u003e? customData;\n}\n```\n\n#### PlayerEvent\nEnumeration of all supported video player events:\n\n- `play` - Video playback started *(automatically triggers viewBegin and playerReady)*\n- `pause` - Video playback paused\n- `playing` - Video is currently playing\n- `seeking` - User is seeking to a new position\n- `seeked` - Seek operation completed\n- `buffering` - Video is buffering\n- `buffered` - Buffering completed\n- `variantChanged` - Video quality/bitrate changed\n- `viewBegin` - Video view session started *(handled automatically by SDK)*\n- `viewCompleted` - Video view session completed\n- `playerReady` - Player is ready to play *(handled automatically by SDK)*\n- `ended` - Video playback ended\n- `error` - Player error occurred\n- `pulse` - Periodic heartbeat event\n\n### Builder Pattern\n\nThe SDK uses a builder pattern for easy configuration:\n\n```dart\nfinal metrics = FastPixMetrics.builder()\n  .setWorkSpaceId('workspace-123')\n  .setBeaconUrl('https://analytics.example.com')\n  .setViewerId('user-456')\n  .setPlayerData(playerData)\n  .setVideoData(videoData)\n  .setCustomData(customDataList)\n  .isEnableLogging(true)\n  .build();\n```\n\n## Configuration\n\n### Required Parameters\n\n- **workspaceId**: Unique identifier for your workspace/application\n- **beaconUrl**: Endpoint URL for sending analytics data\n- **viewerId**: Unique identifier for the current user/viewer\n\n### Important Note\n\n**Automatic Event Handling**: The SDK automatically manages `viewBegin` and `playerReady` events when you dispatch the `play` event. Developers only need to dispatch the `play` event - the SDK handles the rest internally for optimal analytics tracking.\n\n### Optional Parameters\n\n- **playerData**: Information about the video player (name, version, etc.)\n- **videoData**: Video metadata (title, duration, quality, etc.)\n- **customData**: Additional custom fields for your analytics\n- **enableLogging**: Enable/disable debug logging\n\n### Environment Setup\n\n1. **Workspace Configuration**: Set up your analytics workspace and obtain the workspace ID\n2. **Beacon Endpoint**: Configure your analytics server endpoint\n3. **User Identification**: Implement a system to generate unique viewer IDs\n\n## Examples\n\n### Basic Video Player Integration\n\n```dart\nclass VideoPlayerWidget extends StatefulWidget {\n  @override\n  _VideoPlayerWidgetState createState() =\u003e _VideoPlayerWidgetState();\n}\n\nclass _VideoPlayerWidgetState extends State\u003cVideoPlayerWidget\u003e {\n  late FastPixMetrics metrics;\n  \n  @override\n  void initState() {\n    super.initState();\n    \n    // Initialize SDK\n    metrics = FastPixMetrics.builder()\n      .setWorkSpaceId('video-app-123')\n      .setBeaconUrl('https://analytics.videoapp.com')\n      .setViewerId('user-${DateTime.now().millisecondsSinceEpoch}')\n      .build();\n      \n    // Note: No need to dispatch playerReady or viewBegin events\n    // SDK handles these automatically when play event is dispatched\n  }\n  \n  void onPlay() {\n    // Only dispatch play event - SDK automatically handles viewBegin and playerReady\n    metrics.dispatchEvent(PlayerEvent.play);\n  }\n  \n  void onPause() {\n    metrics.dispatchEvent(PlayerEvent.pause);\n  }\n  \n  void onSeek(Duration position) {\n    metrics.dispatchEvent(PlayerEvent.seeking);\n    // After seek completes\n    metrics.dispatchEvent(PlayerEvent.seeked);\n  }\n}\n```\n\n### Custom Data Integration\n\n```dart\n// Create custom data fields\nfinal customData = [\n  CustomData(value: 'movie'),\n  CustomData(value: 'action'),\n  CustomData(value: '2024'),\n];\n\n// Configure SDK with custom data\nfinal metrics = FastPixMetrics.builder()\n  .setWorkSpaceId('workspace-123')\n  .setBeaconUrl('https://beacon.example.com')\n  .setViewerId('user-789')\n  .setCustomData(customData)\n  .build();\n```\n\n### Advanced Event Tracking\n\n```dart\n// Track events with additional attributes\nawait metrics.dispatchEvent(\n  PlayerEvent.variantChanged,\n  attributes: {\n    'height': '1080',\n    'width': '1920',\n    'bitrate': '5000000',\n    'frameRate': '30',\n    'codecs': 'avc1.640028',\n    'mimeType': 'video/mp4',\n  },\n);\n```\n\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n\n## Support\n- **Email**: support@fastpix.io\n\n## Changelog\n\nSee [CHANGELOG.md](CHANGELOG.md) for a detailed history of changes and updates.\n\n---\n\n**Made with ❤️ by the Flutter Core SDK Team**\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffastpix%2Fflutter-core-data-sdk","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffastpix%2Fflutter-core-data-sdk","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffastpix%2Fflutter-core-data-sdk/lists"}