Building a Customer Support Portal, Ticket Desk, and Realtime Live Chat on Habify Base
Launch a Help Center, private ticket tracking desk, and realtime live chat widget backed by managed WebSockets without maintaining separate socket clusters.

You can operate a full Help Center, role-isolated ticket inbox, and realtime live chat desk on Habify Base without managing custom Redis Pub/Sub or WebSocket infrastructure. Built-in chat and notification pipelines isolate every conversation cleanly per project.
Help articles and ticket metadata live inside your dedicated PostgreSQL 18 database, while bidirectional messages, typing indicators, reactions, and unread badges stream live over managed Reverb WebSocket channels.
1. Multi-Channel Support Desk & Live Chat Architecture
Whether a visitor is browsing anonymously or signed into a member account, every channel enforces clear access boundaries:
| Support Feature | Habify Base Capability | Privacy Boundary |
|---|---|---|
| Public Help Center (FAQ) | Multi-keyword Data API search with exact totals | Unauthenticated readers access published articles only |
| Ticket tracking | support_tickets table with PostgreSQL RLS | Customers see own tickets; agents read full queue |
| Member live chat | Browser-ready chat endpoints (/v1/chat/me/*) | Gateway automatically namespaces participants per project |
| Anonymous visitor chat | Server-assisted guest ref + Turnstile gate | Stops bot floods before opening support threads |
| Agent & user inbox alerts | Managed Notification inbox & Reverb WebSockets | Keeps unread counters synced across browser tabs |
| Error screenshots & logs | Private R2 storage + 5-minute signed URLs | Customer attachments stay hidden from public URLs |
2. Separating Public FAQs from Private Customer Tickets
Row-Level Security lets your frontend serve public Help Center pages from the exact same API connection while blocking any customer from viewing another person's support ticket.
Staff signing in with role claim 'support_agent' automatically unlock queue visibility inside PostgreSQL:
CREATE TABLE public.faq_articles (
id uuid PRIMARY KEY DEFAULT gen_random_uuid(),
slug text NOT NULL UNIQUE,
title text NOT NULL,
summary text NOT NULL,
body_md text NOT NULL,
is_published boolean NOT NULL DEFAULT false
);
ALTER TABLE public.faq_articles ENABLE ROW LEVEL SECURITY;
ALTER TABLE public.faq_articles FORCE ROW LEVEL SECURITY;
CREATE POLICY faq_public_read ON public.faq_articles
FOR SELECT USING (is_published = true);
CREATE TABLE public.support_tickets (
id uuid PRIMARY KEY DEFAULT gen_random_uuid(),
customer_id uuid NOT NULL,
subject text NOT NULL,
status text NOT NULL DEFAULT 'open',
priority text NOT NULL DEFAULT 'normal',
created_at timestamptz NOT NULL DEFAULT now()
);
ALTER TABLE public.support_tickets ENABLE ROW LEVEL SECURITY;
ALTER TABLE public.support_tickets FORCE ROW LEVEL SECURITY;
CREATE POLICY tickets_customer_own ON public.support_tickets
USING (
customer_id::text = current_setting('app.current_user_id', true)
OR current_setting('app.current_role', true) = 'support_agent'
)
WITH CHECK (
customer_id::text = current_setting('app.current_user_id', true)
OR current_setting('app.current_role', true) = 'support_agent'
);3. Wiring Realtime Live Chat for Signed-In Members and Guests
Signed-in members call habifyPublic.chat directly from browser components to send messages, emit typing indicators, and subscribe to private Reverb WebSocket channels.
For anonymous visitors opening a website chat bubble, route initial session setup through a Turnstile-protected server Route Handler:
// A. Trình duyệt thành viên (dùng khóa public + phiên đăng nhập user)
const rtConfig = await habifyPublic.chat.getRealtimeConfig();
const { data: conversations } = await habifyPublic.chat.getMyConversations();
await habifyPublic.chat.sendMessage(conversationId, {
type: "text",
body: "Mình cần kiểm tra tiến độ đơn hàng #DH1024.",
});
await habifyPublic.chat.authenticateRealtime({ socket_id, channel_name });
// B. Server Route Handler cho khách vãng lai (đã qua kiểm tra Turnstile)
const guestRef = `guest_${verifiedVisitorSessionId}`;
await habifyServer.chat.upsertParticipant(guestRef, { display_name: "Khách mới" });
const conv = await habifyServer.chat.createDirectConversation({
participant_ref: guestRef,
target_ref: "agent_queue_main",
});
await habifyServer.chat.sendConversationMessage(String(conv.id), {
sender_ref: guestRef,
body: userMessage,
});4. Private R2 Attachments and Anti-Abuse Guardrails
Customer screenshots and log archives upload straight into private object storage scoped to your project prefix rather than public URLs.
Authorized support agents request a 5-minute signed download URL whenever inspecting a ticket attachment, while Gateway rate limits and storage caps prevent flood abuse.
Frequently Asked Questions
Do I need an external Pusher account or custom Socket.IO server for live chat?
No. Managed Reverb WebSocket channels are built right into Habify Base with browser CORS support.
Can website visitors chat with agents before creating an account?
Yes. Protect an initialization Route Handler with Turnstile and link a signed guest reference directly to your support team queue.
Can support chat messages leak between separate Habify Base projects?
Never. Every participant identifier and WebSocket authorization token is strictly isolated by project scope.
Related Documentation & Guides
Launch This Architecture in Free Sandbox in 3 Minutes
Spin up an isolated PostgreSQL 18 database, grab your hb_pk_* / hb_sk_* keys, and wire @habifybase/sdk.