https://github.com/bugsnag/bugsnag-flutter-dart-io-http-client
A wrapper for Dart's IO package for BugSnag SDKs.
https://github.com/bugsnag/bugsnag-flutter-dart-io-http-client
breadcrumbs bugsnag dart flutter flutter-package http io performance platforms
Last synced: 3 months ago
JSON representation
A wrapper for Dart's IO package for BugSnag SDKs.
- Host: GitHub
- URL: https://github.com/bugsnag/bugsnag-flutter-dart-io-http-client
- Owner: bugsnag
- License: mit
- Created: 2024-03-11T13:48:17.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-06-27T08:55:39.000Z (about 2 years ago)
- Last Synced: 2026-02-11T01:45:10.005Z (5 months ago)
- Topics: breadcrumbs, bugsnag, dart, flutter, flutter-package, http, io, performance, platforms
- Language: Dart
- Homepage: https://docs.bugsnag.com/platforms/flutter
- Size: 18.6 KB
- Stars: 1
- Watchers: 14
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# BugSnag Flutter Dart:io Http Client Wrapper
A wrapper for [Dart:io HTTP](https://api.dart.dev/stable/3.3.1/dart-io/dart-io-library.html) that enables automated instrumentation via the BugSnag Performance SDK and Error Monitoring SDK. This package simplifies the process of tracking and monitoring HTTP requests in your Dart applications.
## Features
- **Automated Request Instrumentation**: Automatically creates network spans for HTTP requests and sends them to the BugSnag Performance dashboard.
## Getting Started
To use the `BugsnagHttpClient` wrapper in your Dart project, first add the dependency to your `pubspec.yaml` file:
```yaml
dependencies:
bugsnag_flutter_dart_io_http_client: ^1.0.0 # Use the latest version
```
Then, run pub get in your terminal to fetch the package.
## Usage
Here's a simple example of using BugSnagHttpClient:
```dart
// Import the wrapper
import 'package:bugsnag_flutter_dart_io_http_client/bugsnag_flutter_dart_io_http_client.dart' as dart_io;
// add Bugsnag Performance as a subscriber. This only needs to be done once in your apps lifecycle.
dart_io.addSubscriber(BugsnagPerformance.networkInstrumentation);
// Make a request
final client = dart_io.BugsnagHttpClient();
HttpClientRequest request = await client.getUrl(FixtureConfig.MAZE_HOST);
await request.close();
```
## Support
* [Read the integration guide](https://docs.bugsnag.com/performance/flutter/)
* [Search open and closed issues](https://github.com/bugsnag/bugsnag-flutter-dart-io-http-client/issues?utf8=✓&q=is%3Aissue) for similar problems
* [Report a bug or request a feature](https://github.com/bugsnag/bugsnag-flutter-dart-io-http-client/issues/new)
## License
The BugSnag Flutter Performance SDK is free software released under the MIT License. See the [LICENSE](./LICENSE) for details.