Skip to main content
All methods are static on ClarioDesk. Reads are exposed as Streams that auto-prime and then live-update.

Lifecycle

init

Future<void> ClarioDesk.init({
  required String apiKey,
  ClarioDeskTheme? theme,
})
Call once at app start. Generates the hardware key + registers the device on first launch; reuses it afterward. Pass a theme only if you use the prebuilt UI.

identify

Future<void> ClarioDesk.identify({
  required String externalId,
  String? email,
  Map<String, Object?> traits,
})
Attach your user’s identity to the device. Idempotent — safe to call on every launch. Metadata only; see authentication.

reset

Future<void> ClarioDesk.reset()
Revoke the device server-side, wipe the hardware key, clear caches. Call on logout / user switch. The next init() registers a fresh device.

Tickets & messages

createTicket

Future<Ticket> ClarioDesk.createTicket({
  required String subject,
  required String body,
  List<OutgoingAttachment> attachments,
})

sendMessage

Future<Message> ClarioDesk.sendMessage(
  String ticketId,
  String body, {
  List<OutgoingAttachment> attachments,
})
Optimistic — the message appears as pending immediately and settles on success.

ticketsStream

Stream<List<Ticket>> ClarioDesk.ticketsStream()
Reactive inbox. Auto-primes from cache, then streams live updates.

messagesStream

Stream<List<Message>> ClarioDesk.messagesStream(String ticketId)
Reactive thread for one ticket.

CSAT

submitCsat

Future<void> ClarioDesk.submitCsat(
  String ticketId, {
  required int score,   // 1 (😞) · 2 (😐) · 3 (😊)
  String? comment,
})
See CSAT.

Attachments

attachmentUploadProgress

ValueListenable<double> ClarioDesk.attachmentUploadProgress(String localId)
Per-upload progress, 0.01.0.

refreshAttachmentUrl

Future<Attachment> ClarioDesk.refreshAttachmentUrl(String attachmentId)
Re-presign an expired GET URL. See Attachments.

Push

handlePushPayload

void ClarioDesk.handlePushPayload(Map<String, dynamic> payload)
Call from your push handler to deep-link to the relevant ticket. See Push notifications.

Connection

connectionStream

Stream<ConnectionState> ClarioDesk.connectionStream()
Observe realtime connection state: connecting, connected, reconnecting, disconnected, fatal. See Realtime.
The React Native SDK mirrors this surface 1:1 with the same method names and semantics. If a method behaves differently across the two, it’s a bug — see the RN API reference.