SuperViz Logo

Package versions Discord GitHub issues GitHub pull requests

SuperViz Real-time

SuperViz Real-time is a powerful package that enables real-time communication and collaboration in Dart-based applications. It provides a simple yet flexible API for creating channels, publishing events, and subscribing to real-time updates.

Features

  • Easy integration with Flutter projects
  • Real-time communication between participants
  • Flexible event publishing and subscription system
  • Support for both package manager and CDN installation methods

Installation

Using the pub manager

dart pub add superviz_realtime

or

flutter pub add superviz_realtime

This will add a line like this to your package's pubspec.yaml (and run an implicit flutter pub get):

dependencies:
  superviz_realtime: ^1.0.0

Import it

Now in your Dart code, you can use:

import 'package:superviz_realtime/superviz_realtime.dart';

Example

import 'package:superviz_realtime/superviz_realtime.dart';

// Initialize Real-time
final realtime = Realtime(
  RealtimeAuthenticationParams(
    clientId: 'CLIENT_ID',
    secret: 'SECRET_KEY',
  ),
  RealtimeEnvironmentParams(
    participant: Participant(
      id: 'PARTICIPANT_ID',
    ),
    // Optional parameter (default value: false):
    debug: false,
  ),
);

// Connect to a channel
final channel = await realtime.connect("my-channel");

// Publish an event
channel.publish("test", { 'message': "Hello, world!" });

// Subscribe to events
channel.subscribe("test", (event) {
  print("Received test event: $event");
});

Documentation

For more detailed information on how to use SuperViz Real-time, please refer to our official documentation.

Getting Started

To start using SuperViz Real-time, you'll need to create an account to retrieve your Developer Key or Client ID and Secret.

Support

If you have any questions or need assistance, please join our Discord community or open an issue on our GitHub repository.

License

SuperViz Real-Time is licensed under the BSD 2-Clause License.

Libraries

superviz_realtime