Dart SDK
Official SDK for Dart — capture exceptions, set environment and release.
Building a Flutter app? Use the Flutter guide for framework error hooks and widget-aware setup.
Install
Add the package to your pubspec.yaml, then run dart pub get.
pubspec.yamlyaml
dependencies:
talaria: ^1.0.0Configure
Use a project API key (tal_live_…). Prefer compile-time or runtime config — never hardcode keys in source.
talaria.dartdart
import 'package:talaria/talaria.dart';
final client = TalariaClient(
dsn: const String.fromEnvironment(
'TALARIA_DSN',
defaultValue: 'https://api.newtalaria.com',
),
apiKey: const String.fromEnvironment('TALARIA_API_KEY'),
environment: const String.fromEnvironment(
'APP_ENV',
defaultValue: 'production',
),
release: const String.fromEnvironment('APP_RELEASE'),
);Capture exceptions
dart
try {
await riskyOperation();
} catch (error, stackTrace) {
await client.captureException(
error,
stackTrace: stackTrace,
tags: {'area': 'checkout'},
);
rethrow;
}Environments & releases
Set environment and optional release from your build config or CI so the dashboard can filter issues and correlate deploys.
Troubleshooting
- 401/403 — check API key and that it belongs to the target project.
- No issue appears — confirm environment filter in the dashboard.
- Rejected events — validate JSON shape against the API overview.
Prefer another platform? See all SDKs or send events over HTTP via the API overview.