Reference
Effects reference
Every effect a webhook reply or an onSuccess list can ask for.
An effect is an object with a type. Effects appear in three places: the effects list of a webhook reply, and an action's onSuccess and onError. An effect with no fields may be written as just its name, for example "dismiss".
dismiss
Remove the card.
No fields.
{
"type": "dismiss"
}patchData
Merge new values into the card's data.
| Field | Type | Required | What it is |
|---|---|---|---|
data | object | yes | Object merged into data. |
{
"type": "patchData",
"data": {
"count": 5
}
}setState
Merge new values into the card's local state.
| Field | Type | Required | What it is |
|---|---|---|---|
state | object | yes | Object merged into state. |
{
"type": "setState",
"state": {
"open": false
}
}replace
Replace the card's content.
| Field | Type | Required | What it is |
|---|---|---|---|
ui | Element | New element tree. | |
data | object | New data. | |
title | string | New title. |
{
"type": "replace"
}toast
Show a short message.
| Field | Type | Required | What it is |
|---|---|---|---|
message | string | yes | The message. |
tone | "default" "success" "danger" | default, success or danger. |
{
"type": "toast",
"message": "…"
}openUrl
Open a link.
| Field | Type | Required | What it is |
|---|---|---|---|
url | string | yes | Address to open. |
{
"type": "openUrl",
"url": "https://your-app.example/hook"
}error
Report a failure to the user.
| Field | Type | Required | What it is |
|---|---|---|---|
message | string | yes | What went wrong. |
{
"type": "error",
"message": "…"
}