Skip to main content

apialerts 1.0.0 copy "apialerts: ^1.0.0" to clipboard
apialerts: ^1.0.0 copied to clipboard

Dart client for the API Alerts notification platform. Send once, deliver everywhere.

example/example.dart

import 'package:apialerts/apialerts.dart';

Future<void> main() async {
  ApiAlerts.configure('your-api-key');

  // Fire-and-forget.
  ApiAlerts.send(const Event(message: 'Deploy complete'));

  // Or await the result.
  final result = await ApiAlerts.sendAsync(const Event(
    message: 'New user signed up',
    channel: 'revenue',
    event: 'user.signup',
    title: 'New Signup',
    tags: ['growth'],
    link: 'https://dashboard.example.com/users/123',
    data: {'plan': 'pro'},
  ));
  print(result.success
      ? 'Sent to ${result.workspace} (${result.channel})'
      : 'Failed: ${result.error}');

  // Instance client, for DI or multiple keys.
  ApiAlertsClient('your-api-key').send(const Event(message: 'From a client'));
}
0
likes
160
points
54
downloads

Documentation

API reference

Publisher

unverified uploader

Weekly Downloads

Dart client for the API Alerts notification platform. Send once, deliver everywhere.

Homepage
Repository (GitHub)
View/report issues

Topics

#notifications #alerts #monitoring #sdk

License

MIT (license)

Dependencies

http

More

Packages that depend on apialerts