veta_chat_kit_firebase 0.1.1
veta_chat_kit_firebase: ^0.1.1 copied to clipboard
Firestore + FirebaseAuth adapter for veta_chat_kit — realtime threads, presence, typing.
veta_chat_kit_firebase #
Firestore + FirebaseAuth adapter for veta_chat_kit.
Realtime threads, presence, and typing indicators.
⚠️ Firestore setup required. From your app directory, run:
dart run veta_firebase_setup firebase deploy --only firestore:rulesSee
firebase/SETUP.mdfor collections, rules, and indexes this adapter expects.
Usage #
await Firebase.initializeApp(options: ...);
configureVetaKits(
chat: firebaseChatStrategy(), // defaults to FirebaseFirestore.instance + FirebaseAuth.instance
);
Override collection roots if you need a different layout:
firebaseChatStrategy(threadsCollection: 'rooms');
What you get #
| Method | Returns |
|---|---|
watchThread(threadId) |
Stream<ChatMessage> — new messages live |
send(threadId, text) |
writes to threads/{id}/messages |
watchPresence(threadId) |
Stream<Set<userId>> of online users |
watchTyping(threadId) |
Stream<Set<userId>> currently typing |
setTyping(threadId, bool) |
toggles your typing flag |
The host app must create the parent threads/{threadId} document with a
participantIds: [uid, …] field so the security rules can authorize
participants.