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

WebSocket Client SDK from PieSocket Channels

Dart WebSocket Client #

PieSocket Channels SDK for Flutter written in Dart.

This SDK can be used to communicate with any third-party WebSocket server, and implements auto-reconnection among other best WebSocket practices.

Installation #

Add PieSocket Channels into your project.

flutter pub add piesocket_channels

Usage #

Import the library

import 'package:piesocket_channels/channels.dart';

Stand-alone Usage #

Create a Channel instance as shown below.

Chanel channel = Channel.connect("wss://example.com", true)

channel.listen("system:message", (PieSocketEvent event) {
    log("WebSocket message arrived!");
    print(event.toString());
});

PieSocket's managed WebSocket server #

Use following code to create a Channel with PieSocket's managed WebSocket servers.

Get your API key and Cluster ID here: Get API Key

PieSocketOptions options = PieSocketOptions();
options.setClusterId("demo");
options.setApiKey("VCXCEuvhGcBDP7XhiJJUDvR1e1D3eiVjgZ9VRiaV");

PieSocket piesocket = PieSocket(options);
Channel channel = piesocket.join("chat-room");

PieSocket Channels is scalable WebSocket API service with following features:

  • Authentication
  • Private Channels
  • Presence Channels
  • Publish messages with REST API
  • Auto-scalability
  • Webhooks
  • Analytics
  • Authentication
  • Upto 60% cost savings

We highly recommend using PieSocket Channels over self hosted WebSocket servers for production applications.

Events #

system:connected is the event fired when WebSocket connection is ready, get a full list system messages here: PieSocket System Messages

Documentation #

For usage examples and more information, refer to: Official SDK docs

0
likes
90
pub points
71%
popularity

Publisher

verified publisherpiesocket.com

WebSocket Client SDK from PieSocket Channels

Homepage

Documentation

API reference

License

unknown (LICENSE)

Dependencies

flutter, http, uuid, web_socket_channel

More

Packages that depend on piesocket_channels