Skip to main content
All methods live on the ClarioDesk singleton. subscribe* methods return an unsubscribe function; the React hooks mirror each subscription.
import { ClarioDesk } from '@clariodesk/react-native';

Lifecycle

ClarioDesk.init({ apiKey, pushTokenProvider?, attachments? }): Promise<void>
ClarioDesk.identify({ externalId, email?, traits? }): Promise<void>
ClarioDesk.reset(): Promise<void>
ClarioDesk.isInitialized(): boolean
ClarioDesk.isIdentified(): boolean

Tickets & messages

ClarioDesk.createTicket({ subject, body, attachments? }): Promise<{ ticket: Ticket }>
ClarioDesk.sendMessage(ticketId, body, { attachments? }?): Promise<Message>
ClarioDesk.retryMessage(message): Promise<Message>   // for failed optimistic sends
ClarioDesk.markRead(ticketId): Promise<void>
ClarioDesk.setTyping(ticketId, isTyping): void
ClarioDesk.fetchTickets(): Promise<Ticket[]>          // one-shot
ClarioDesk.fetchTicket(ticketId): Promise<Ticket>     // one-shot
A message with pending: true is optimistic; failed: true means rejected β€” render tap-to-retry with retryMessage. Offline sends stay pending and auto-flush on reconnect.

Live subscriptions

Each returns an unsubscribe function.
ClarioDesk.subscribeTickets(cb): () => void
ClarioDesk.subscribeMessages(ticketId, cb): () => void
ClarioDesk.subscribeTyping(ticketId, cb): () => void
ClarioDesk.subscribeAgentPresence(cb): () => void
ClarioDesk.subscribeConnection(cb): () => void   // connecting | connected | reconnecting | disconnected | fatal
ClarioDesk.subscribeSync(cb): () => void
ClarioDesk.subscribeState(cb): () => void
ClarioDesk.subscribePushOpened(cb): () => void

Hooks

The same data, idiomatic for React (separate entry, no React dep in core):
import {
  useTickets, useMessages, useTyping, useAgentPresence,
  useConnection, useSync, usePushOpened,
} from '@clariodesk/react-native/hooks';

CSAT

ClarioDesk.submitCsat(ticketId, { score, comment? }): Promise<void>
// score: 1 (😞) · 2 (😐) · 3 (😊)

Push

ClarioDesk.registerPushToken(token): Promise<void>
ClarioDesk.isClarioMessage(data): boolean
ClarioDesk.parsePushPayload(data): ParsedPush | null
ClarioDesk.openTicketFromPush(data): void
ClarioDesk.getNotificationPreferences(): Promise<NotificationPreferences>
ClarioDesk.setNotificationPreferences(prefs): Promise<void>
See the push guide.

Attachments

ClarioDesk.attachmentUploadProgress(stubId): Subscribable<number>
ClarioDesk.refreshAttachmentUrl(attachmentId): Promise<Attachment>

Types

All types are exported: Ticket, Message, Attachment, OutgoingAttachment, readStateOf, ClarioDeskError, and the enums above.
This surface mirrors the Flutter SDK 1:1. Same method names, same semantics. If a method behaves differently across the two, it’s a bug.