io library

connectChat: Kick's chat feed over dart:io's HttpClient and WebSocket.

Classes

Backoff
Reconnect delays: 1 s doubling to 30 s, back to 1 s once connected.
ChatConnection
A live connection to one channel's chat, from connectChat.
Content
Chat message text.
Events
Kick's chat-feed events, typed: {"type": "chat_message", ...}.
KickRequest
A request to send, with whatever HTTP client the app uses.
PublicApi
Kick's official API (api.kick.com/public/v1).
Realtime
Kick's realtime chat feed. Its server only accepts a WebSocket with Origin: https://kick.com; connectChat in package:kicksdk/io.dart sends it.
Session
One connection's worth of Kick's Centrifugo protocol. Each method returns the actions to carry out: {"action": "send", "text": ...}, close, refresh_token, connected, subscribed, unsubscribed, subscribe_failed, event. Times are milliseconds.
Webhooks
Kick's official webhooks.
Website
kick.com's own endpoints (kick.com/api/v2): undocumented, a grey area under Kick's terms. Treat a failure as a gap.

Functions

connectChat({required int chatroomId, int? channelId, List<String>? channels, required void onEvent(Map<String, dynamic> event), void onState(bool connected, List<String> subscribed)?, void onDrop(String reason)?, Map<String, String>? endpoints}) → ChatConnection
Connects to one channel's chat and keeps it up until ChatConnection.close.

Typedefs

Json = Map<String, dynamic>

Exceptions / Errors

KickException
Kick answered with an error, or a call could not be made.