NPAW Forge for Flutter
NPAW analytics for Flutter apps on Android, iOS, and Web. npaw_forge drives
the native Forge Rust analytics runtime over Dart FFI on mobile and the Forge
Web runtime on Flutter Web, with one Dart API: sessions, adapterless video/ad
reporting, network observations, diagnostics streams, and a player-adapter
framework.
Player adapters ship separately; use
npaw_forge_video_player
for the video_player package (also covers chewie and pod_player).
Usage
import 'package:npaw_forge/npaw_forge.dart';
final forge = await NpawForge.start(
const ForgeConfig(
accountCode: 'yourAccountCode',
appName: 'my-flutter-app',
),
);
WidgetsBinding.instance.addObserver(ForgeLifecycleObserver(forge));
Manual video reporting for any player:
final video = await forge.createVideo(
metadata: const ContentMetadata(
player: 'MyPlayer',
resource: 'https://cdn.example.com/movie.m3u8',
title: 'Movie',
),
);
await video.fireStart();
await video.fireJoin();
// ... firePause / fireResume / fireBufferBegin / fireSeekBegin / fireStop
await video.dispose();
On Flutter Web, add the NPAW Forge Web runtime script to web/index.html:
<script src="npaw-forge-web.iife.js" defer></script>
See the NPAW Forge Flutter integration guide for full setup, the video_player adapter, ad reporting, capture behavior on the web target, and troubleshooting. NPAW customers can reach support through the usual channels.
Libraries
- npaw_forge
- testing
- Testing support for Forge adapter packages and custom adapters.