Support API Reference
Reference for the public exports from react-actions-chat-support.
The package exports two flow factories, one in-memory adapter factory, and the types needed to replace or customize every support operation.
Main Flow Creators
createSupportUserFlow(config)
Creates the customer-facing support flow. It can open tickets, list the customer's tickets, show ticket activity, append details, start live chat, refresh live chat, and end live chat.
Required config:
customer
Returned API:
initialMessagesprimaryButtonsstart(): void
Important config fields:
adaptercallbackscustomerbrandNameinitialMessagevalidationlabelsrequestInputsformattersfilterOptionsbehaviorcustomizeButtonsliveChatPersistentButtons
If neither adapter nor the matching callbacks provide an operation, the flow hides buttons for that capability. For example, Start ticket requires ticket creation, and View tickets requires customer ticket listing.
createSupportAdminFlow(config)
Creates the agent/admin support flow. It can list ticket queues, review a ticket by reference, list assigned work, assign tickets, reply to customers, set priority, reopen or resolve tickets, list live-chat queues, join live chats, reply in live chat, leave live chat, and end live chat.
Required config:
agent
Returned API:
initialMessagesprimaryButtonsstart(): void
Important config fields:
adaptercallbacksagentbrandNameinitialMessagevalidationlabelsrequestInputsconfirmationsformattersfilterOptionsbehaviorcustomizeButtonsliveChatPersistentButtons
Admin primary buttons are capability-aware. Queue buttons require queue-listing methods, review-by-reference requires ticket lookup, and live-chat actions require the corresponding live-chat adapter or callback operations.
Runtime Shape
Both flow factories return SupportFlowBase:
initialMessages: messages to pass to<Chat initialMessages={...} />.primaryButtons: default top-level actions for the flow.start(): imperatively appends the opening support message to the current chat store.
Use initialMessages for the normal mount path. Use start() when the chat is already mounted and you want to start the flow from another button or event.
Adapter Helper
createInMemorySupportFlowAdapter(options?)
Creates a self-contained SupportFlowAdapter for demos, tests, and local development.
Important options:
ticketsliveChatsnextTicketNumbernextTicketMessageNumbernextLiveChatNumbernextLiveChatMessageNumbernowcreateTicketReferencecreateTicketSubjectcreateTicketMessageIdcreateLiveChatIdcreateLiveChatMessageIddefaultTicketStatusdefaultTicketPrioritydefaultQueueStatusesdefaultLiveChatQueueStatusesgetLiveChatQueuePositiongetEstimatedWaitMinutesmatchCustomersortTicketssortLiveChats
Default ticket references are generated as SUP-1000, SUP-1001, and so on. Default live-chat IDs are generated as chat-0001, chat-0002, and so on. Customer matching uses id, then email, then name when those values are available.
Adapter Contract
SupportFlowAdapter
Shared backend contract used by both support flows. Every method can return a value directly or a promise.
createTicket(input): creates a ticket from customer, summary, optional subject, optional priority, and optional tags.getTicketByReference(reference): returns one ticket ornull.listCustomerTickets(customer, request?): returns tickets owned by a customer.listQueue(filter?, request?): returns tickets for admin queues.listLiveChatQueue(filter?): returns live-chat sessions for admin queues.getLiveChatById(sessionId): returns one live-chat session ornull.listCustomerLiveChats(customer): returns live chats associated with a customer.updateTicket(input): patches ticket status, priority, assignee, or live-chat-offered state.appendTicketMessage(input): adds a customer, agent, or system message to a ticket.startLiveChat(input): opens or returns a live-chat session.updateLiveChat(input): patches live-chat status, queue position, wait estimate, or assigned agent.appendLiveChatMessage(input): appends a customer, agent, or system message to a live-chat transcript.
Queue Filters
SupportQueueFilter includes:
statuses?assignedTo?- custom pass-through fields
SupportLiveChatQueueFilter includes:
statuses?requestedBy?- custom pass-through fields
Use custom fields when your backend supports richer filters than the package needs directly.
Paged Ticket Results
Customer and admin ticket-listing methods can return either a complete SupportTicket[] or SupportTicketListResult.
SupportTicketListRequest includes:
pageIndexpageSize?offsetlimit?
SupportTicketListResult includes:
ticketstotalTickets?hasMore?nextOffset?
Return the paged result shape when the backing database can only read part of a larger ticket set. The support flow passes offset and limit into the next call, and uses totalTickets, hasMore, or nextOffset to decide whether to show Next tickets. Return nextOffset when the backend needs a custom offset for the next page.
Callback Contracts
Callbacks override adapter operations one method at a time. Use them when a specific flow should call a special endpoint or when you do not want to provide a complete adapter.
SupportUserFlowCallbacks
createTicket(input)getTicket(reference)listTickets(customer, request?)appendTicketMessage(input)startLiveChat(input)getOpenLiveChat(customer)getLiveChat(sessionId)updateLiveChat(input)appendLiveChatMessage(input)
SupportAdminFlowCallbacks
listTicketQueue(filter?, request?)listLiveChatQueue(filter?)getTicket(reference)updateTicket(input)appendTicketMessage(input)getLiveChat(sessionId)updateLiveChat(input)appendLiveChatMessage(input)
Customization Reference
Labels
labels accepts partial label overrides for a flow.
Customer labels include ticket entry, live-chat entry, ticket paging, ticket detail, support-options navigation, live-chat refresh, live-chat end, live-chat message placeholders, and waiting-state copy.
Admin labels include ticket queue, live-chat queue, assigned work, ticket review, queue paging, navigation, live-chat join/leave/end/refresh, assignment, priority selection, full activity, reply, reopen, resolve, and live-chat reply copy.
Request Inputs
Customer requestInputs slots:
createTicketaddTicketDetailstartLiveChat
Admin requestInputs slots:
reviewTicketassignTicketreplyToCustomersetPriority
Every request-input override uses SupportRequestInputButtonOverrides<TContext>:
initialLabelinputPromptMessageplaceholderinputDescriptioninputTypeinputOptionsallowFileUploadfileValidatorvalidatorminMessageLengthminMessageLengthMessageabortLabelshowAbortshouldWaitForTurncooldownMscooldownMessageinputTimeoutMsinputTimeoutMessagesuppressValidationFailureMessagevariantclassNamestylerateLimit
Validation
SupportInputValidationSettings fields:
minMessageLengthminMessageLengthMessagemaxMessageLengthmaxMessageLengthMessagevalidator
Customer validation slots:
ticketSummaryticketDetailliveChatInitialMessageliveChatMessage
Admin validation slots:
ticketAssignmentticketReplyliveChatMessage
Confirmations
Admin confirmations.resolveTicket uses SupportConfirmationButtonOverrides<TContext>:
initialLabelconfirmationMessageconfirmLabelrejectLabelvariantclassNamestyle
Formatters
Customer formatter names:
openingMessageticketSummaryticketFullActivityticketListticketCreatedticketDetailAddedliveChatDetailsliveChatEnded
Admin formatter names:
openingMessageticketDetailsticketFullActivityticketQueueliveChatQueueliveChatDetailsliveChatEndedliveChatJoinedliveChatLeftticketAssignedticketPriorityChangedticketReplySentticketReopenedticketResolved
Formatter context includes the flow identity, brand name, configured limits, and the record being rendered. List and queue formatters also receive pagination data, total counts, hasMoreTickets, isTotalTicketsExact, active filter IDs, active filter labels, and the available filter options.
Filter Options
SupportListFilterOption fields:
idlabelisDefaultvariantactiveVariantclassNamestyle
Customer filter groups:
filterOptions.tickets
Admin filter groups:
filterOptions.ticketQueuefilterOptions.assignedWorkfilterOptions.liveChatQueue
Customer ticket filters use local predicates. Admin ticket filters may provide a backend filter, a local predicate, or both. When a backend-paged ticket response is locally filtered with predicate, the flow reads through the backend pages so matches beyond the first page remain reachable. The admin context includes the agent, agent label, queue slot, and base filter. Admin live-chat filters work the same way with live-chat queue filters.
Behavior
Customer behavior fields:
recentActivityLimitticketListLimitisOpenLiveChat(session)canSendLiveChatMessage(session)
Admin behavior fields:
queueLimitliveChatQueueLimitassignedWorkLimitrecentActivityLimittranscriptLimitpriorityOrderstatusTransitionsisTicketResolved(ticket)getTicketQueueButtonVariant(ticket)getLiveChatQueueButtonVariant(session)getAssignedWorkFilter(context)getRequeuedLiveChatPosition(context)getRequeuedLiveChatEstimatedWaitMinutes(context)
SupportAdminStatusTransitions fields:
assignedTicketStatusrepliedTicketStatusreopenedTicketStatusresolvedTicketStatus
Button Customizers
customizeButtons(context) receives the slot, default buttons, flow identity, and any current ticket, ticket list, live-chat session, queue list, pagination, or filter metadata.
Customer button slots:
primaryticketticket-listlive-chat-activelive-chat-waitinglive-chat-endedlive-chat-persistent
Admin button slots:
primaryticketticket-queueassigned-worklive-chatlive-chat-queuelive-chat-persistent
Return context.defaultButtons unchanged to keep a slot as-is.
Persistent Live-Chat Buttons
liveChatPersistentButtons(context) returns buttons that remain available while the current live-chat session is open.
Customer context includes:
sessioncustomerendLiveChatrefresh
Admin context includes:
sessionagentendLiveChatrefresh
Core Types
Status And Priority Values
SupportTicketStatus:
newopenpending-customerpending-internalresolvedclosed
SupportTicketPriority:
lownormalhighurgent
SupportLiveChatStatus:
queuedactiveended
SupportLiveChatMessageAuthor:
customeragentsystem
SupportUserIdentity
Customer identity used for ticket ownership and live-chat matching:
id?name?email?company?
SupportAgentIdentity
Agent identity used for assignment, admin actions, and live-chat ownership:
id?name?email?team?
SupportTicket
Ticket record shared between customer, admin, and adapter flows:
referencesubjectsummarycustomerstatuspriorityassignedTo?liveChatOfferedcreatedAtupdatedAtmessagestags?
SupportTicketMessage
Ticket activity entry:
idauthorauthorLabel?bodycreatedAt
SupportLiveChatSession
Live-chat record shared by customer and admin flows:
idsummaryticketReference?requestedByqueuePositionestimatedWaitMinutesstatuscreatedAtupdatedAt?customer?agent?messages?
SupportLiveChatMessage
Live-chat transcript entry:
idauthorauthorLabel?bodycreatedAt
Input Types
Ticket inputs:
CreateSupportTicketInputUpdateSupportTicketInputAppendSupportTicketMessageInput
Live-chat inputs:
StartSupportLiveChatInputUpdateSupportLiveChatInputAppendSupportLiveChatMessageInput
Utility types:
MaybePromiseSupportTextResolverSupportButtonCustomizerSupportButtonCustomizationContextSupportRequestInputButtonOverridesSupportConfirmationButtonOverridesSupportTicketListRequestSupportTicketListResultSupportTicketListResponse
In-Memory Factory Context Types
Use these when customizing the in-memory adapter's generated references, subjects, IDs, queue positions, wait estimates, matching, or sorting:
InMemorySupportTicketReferenceContextInMemorySupportTicketSubjectContextInMemorySupportTicketMessageIdContextInMemorySupportLiveChatIdContextInMemorySupportLiveChatMessageIdContextInMemorySupportLiveChatQueueContextInMemorySupportLiveChatWaitContextInMemorySupportFlowAdapterOptions