vynelix_relay_flutter 1.0.2 copy "vynelix_relay_flutter: ^1.0.2" to clipboard
vynelix_relay_flutter: ^1.0.2 copied to clipboard

Flutter client for VynRelay. Resilient real-time messaging with WebSocket/SSE fallback.

vynelix_relay_flutter #

A production-grade realtime messaging SDK for Flutter, powered by VynRelay. Supports WebSockets with automatic transparent fallback to Server-Sent Events (SSE).

Features #

  • Protocol Fallback: Automatically switches to SSE if WebSockets are unavailable.
  • Handshake Identity: Support for identity hinting during initial connection.
  • Heartbeat & Reconnect: Intelligent background management of the connection lifecycle.
  • JSON First: Seamlessly handle complex data payloads.

Getting Started #

Add the dependency to your pubspec.yaml:

dependencies:
  vynelix_relay_flutter: ^1.0.0

Usage #

Initialization #

import 'package:vynelix_relay_flutter/vynelix_relay_flutter.dart';

final client = VynClient(VynClientOptions(
  url: 'ws://your-api.com/vynrelay',
  username: 'FlutterUser', // Identity for the initial handshake
));

Authentication #

await client.authenticate('your-jwt-token');

Messaging #

// Subscribe to a topic
client.subscribe('public.chat', (payload) {
  print('New Message: ${payload['text']}');
});

// Publish a message
client.publish('public.chat', {
  'text': 'Hello from Flutter!',
  'timestamp': DateTime.now().toIso8601String(),
});

Lifecycle Management #

// Check connection status
bool isConnected = client.isConnected;
String transport = client.transport; // 'WS' or 'SSE'

// Close connection
client.disconnect();

Additional Information #

For more details on the VynRelay ecosystem, visit vynrelay.com.

License #

MIT

1
likes
140
points
5
downloads

Documentation

API reference

Publisher

unverified uploader

Weekly Downloads

Flutter client for VynRelay. Resilient real-time messaging with WebSocket/SSE fallback.

Repository (GitHub)
View/report issues

License

MIT (license)

Dependencies

collection, flutter, http, nanoid, uuid, web_socket_channel

More

Packages that depend on vynelix_relay_flutter