Menu

1 / 3

Chat SDK now supports callback URLs on buttons and modals - Vercel

Vercel News·Ben Sabic·5 months ago
#uJZpHLzY
#vercel#button#approve#card#callbackurl
Reading 0:00
15s threshold

You can now pause a Workflow run on a Chat SDK card and resume it when someone clicks a button. The same flow works for form submissions. Buttons and modals accept a new callbackUrl prop, and the event payload is sent to that endpoint.

Slack approval card for a status report request

To build a card like this, create a workflow webhook and pass its URL to each button's callbackUrl prop inside your <Card> component:

import { createWebhook } from "workflow" ;

import { Card , CardText , Actions , Button } from "chat" ;

export async function statusReport (

thread ,

content : { title : string ; message : string } ,

) {

"use workflow" ;

using hook = createWebhook < { action : "approve" | "approve-and-send" | "deny" } > ( ) ;

await thread . post (

< Card title = " Status Report Communications " >

< CardText > Title: { content . title } </ CardText >

< CardText > Message: { content . message } </ CardText >

< Actions >

< Button callbackUrl = { hook .…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.