mercure_client

Last updated:

0 purchases

mercure_client Image
mercure_client Images
Add to Cart

Description:

mercure client

The features #
Provide a quick way to consume messages on Mercure.
Consuming messages #
import 'package:mercure_client/mercure_client.dart';

main() async {
final Mercure mercure = Mercure(
url: 'http://example.com/.well-known/mercure', // your mercure hub url
topics: ['/books/{id}'], // your mercure topics
token: 'your_jwt_token', // Bearer authorization
lastEventId: 'last_event_id', // in case your stored last recieved event
);

final subscription = mercure.listen((event) {
print(event.data);
});
}
copied to clipboard

License:

For personal and professional use. You cannot resell or redistribute these repositories in their original state.

Files In This Product:

Customer Reviews

There are no reviews.