Support
The shared inbox, tasks named as tickets, SLAs and a knowledge base, installed as one block.
Covers a help desk. It sets the task names to ticket and issue until the app sets its own.
better-supabase add supportexport default defineConfig({ blocks: { support: {} } });add lists support in blocks, writes the modules of every part and wires the client in lib/blocks.ts. Import the manifest from better-supabase/blocks/support when you build the set with createBlocks.
import { supportBlock } from "better-supabase/blocks/support";Parts
Installing support installs these blocks. Each stays an ordinary block in the config and keeps its own client.
Defaults
Tasks are named ticket and issue. Set blocks.tasks.names in the config to change them; your keys win over the default.
The app's own blocks.<part> settings win key by key (Composite blocks).
Helpers
openTicket: Create a ticket as a task and start its SLA clocks. If the SLA step fails the ticket stays open; call blocks.sla.start again for it.
await blocks.support.openTicket({
organizationId,
ticket: { title: "Cannot sign in" },
priority: "high",
});escalate: Hand a ticket to new assignees and restart its SLA clocks at a higher priority. It calls tasks.assign, which replaces the assignees and notifies the new ones, then sla.start with the new priority. If the SLA step fails the new assignees stay; call blocks.sla.start again for the ticket.
await blocks.support.escalate({
ticketId,
assigneeIds: [leadId],
priority: "urgent",
});The Next.js example calls it from the escalateTicket server action in composite-actions.ts.
The helper returns a Result; each step is idempotent, so retrying after a partial failure is safe.
Remove
better-supabase remove support
better-supabase remove support --with-partsThe first command replaces support in blocks with its parts. The second removes the parts too, except any part another block still needs (remove).
Last updated on