ctx.emit when your client needs a named payload during the turn.
The public API is ctx.reply(content, options?). You can also return a string or JSX card from a handler instead of calling ctx.reply() directly.
To send a reply from your backend without going through the bridge handler, use the Send an agent reply API.
Channel support
See Channels overview for the full matrix.
Reply types
The following table summarizes the reply types your agent can send:
To change a message after you send it, see Edit sent messages.
Plain text
Send a simple string reply withctx.reply():
Markdown
Send formatted text by passing a markdown string toctx.reply():
Quote reply
PassquoteReply to pin the reply to a specific inbound message. WhatsApp and Telegram render a native quote. Other channels send a normal post.
Sending attachments
Include files with string or markdown replies via the optional second argument.Outbound file attachments are delivered on Slack and Microsoft Teams. WhatsApp, Telegram, and email do not support outbound files yet. See Channels overview.
- Attachments are limited to 25 MB per file.
- Files are only supported with string or markdown replies, not card replies.
- Provide each file with exactly one of
urlordata. - Prefer
urlfor larger files. Inlinedatais capped at 5 MB per file (and 5 MB aggregate per message).
File reference type
Each file uses aFileRef object with the following shape:
url for larger files. Novu fetches public HTTP(S) URLs server-side. Use data for small generated files in memory.
The following examples show both approaches:
Interactive cards
Cards are structured messages with buttons, dropdowns, links, and more. Build them with function calls or JSX.- Function call API
- JSX API
The following example builds a card with the function call API:
onAction fires with action.id and action.value. See Handlers and context. On Web Chat, the same tree arrives as a card part. The web UI draws it and calls sendAction.
Available card components
The following table lists the card components you can use in replies:
All components are exported from
@novu/framework (and from @novu/framework/cards and every server entrypoint), so you do not need to install a separate package. Each one works in both the function call API and the JSX API.
Tables, charts, and link buttons
Table, Chart, and LinkButton render structured content inside a card. On channels with native support (such as Slack), they map to the platform’s rich blocks; on others they fall back to plain text.
Tabletakesheaders(column labels) androws(an array of cell-string arrays). Optionalcaptionlabels the table, andpageSizesets rows per page on channels that paginate (Slack: 1-100, default 5).Charttakes atitleand achartdefinition. Usetype: 'bar' | 'line' | 'area'withcategoriesandseries, ortype: 'pie'withsegments. On Slack the title is capped at 50 characters, and series and categories are capped at 12.LinkButtonrenders a button that opens aurl, unlikeCardLink, which renders an inline link. Place it insideActions.
On Slack,
Table ignores per-column align. A chart or table that exceeds the platform limits falls back to a plain-text section.Related
Edit sent messages
Update a message in place after sending it with
ReplyHandle.Signals
Metadata, workflow triggers, and conversation resolution.
Emit custom events
Send a named payload. Web Chat renders it as a
data part.AI SDK
Build end to end with
@novu/framework/ai-sdk.Send an agent reply API
Send replies from your backend without a bridge handler.
Web Chat cards
Render
part.type === 'card' in your product UI and call sendAction.