Skip to main content
The ClarioDesk Flutter SDK (clariodesk on pub.dev) gives you a hardware-bound device identity and a live ticket thread with a few method calls.

Install

flutter pub add clariodesk
Requires Flutter ≥ 3.41 / Dart ≥ 3.11, iOS 13+, Android API 23+.

Initialize

The first init generates the hardware key and registers the device with the backend. Subsequent launches reuse the existing key with no network call.
import 'package:clariodesk/clariodesk.dart';

Future<void> main() async {
  WidgetsFlutterBinding.ensureInitialized();
  await ClarioDesk.init(apiKey: 'pk_live_…');
  runApp(const MyApp());
}

Identify the user

After your own auth knows who the user is. Optional, pure metadata — see lifecycle for the four events you should wire (especially case 1, which covers users who were logged in before you installed the SDK).
await ClarioDesk.identify(
  externalId: hostUser.id,
  email: hostUser.email,
  traits: {'plan': 'pro'},
);

File a ticket

final t = await ClarioDesk.createTicket(
  subject: 'Upload broken',
  body: 'Tapping upload does nothing.',
);

Stream the inbox & a thread

Reactive reads — both auto-prime and then live-update.
// Inbox
StreamBuilder<List<Ticket>>(
  stream: ClarioDesk.ticketsStream(),
  builder: (_, snap) {
    final tickets = snap.data ?? const [];
    return ListView(/* render tickets */);
  },
);

// A single thread
StreamBuilder<List<Message>>(
  stream: ClarioDesk.messagesStream(t.id),
  builder: (_, snap) => /* render messages */,
);

Send a reply

await ClarioDesk.sendMessage(t.id, 'Still happening on 1.4.2');

Run the example app

cd example
flutter run --dart-define=CLARIODESK_API_KEY=pk_live_…

Lifecycle integration

Wire login, launch, logout, and user-switch.

Prebuilt UI

Skip building the UI — open a themeable inbox in one call.