Actions reference
Every action a button or input can run, with its fields.
An action is an object with a type. Put one, or a list of them, on a property that takes an action, such as a button's onPress. A list runs in order. For how they fit together, see Actions.
webhook
Hookboard calls your URL. The reply may contain effects. Runs on Hookboard's server.
| Field | Type | Required | What it is |
|---|---|---|---|
url | string | yes | Address to call. |
method | "POST" "PUT" "PATCH" "DELETE" | POST (default), PUT, PATCH or DELETE. | |
name | string | A name for the action, sent in the body. | |
payload | any JSON | Any JSON; expressions are resolved first. | |
headers | object | Extra request headers. | |
confirm | object | Ask first: { title, description, confirmLabel }. | |
onSuccess | Effects | Effects applied when the reply has none. | |
onError | Effects | Effects applied when the call fails. |
{
"type": "webhook",
"url": "https://your-app.example/hook"
}event
Queues an event your app collects from GET /api/v1/events. For senders that cannot receive webhooks. Runs on Hookboard's server.
| Field | Type | Required | What it is |
|---|---|---|---|
name | string | yes | Event name. |
payload | any JSON | Any JSON; expressions are resolved first. | |
confirm | object | Ask first: { title, description, confirmLabel }. | |
onSuccess | Effects | Effects applied once the event is queued. |
{
"type": "event",
"name": "refresh"
}set
Writes a value to local state. Runs on the device, with no request.
| Field | Type | Required | What it is |
|---|---|---|---|
path | string | yes | State path, e.g. state.tab. |
value | any JSON | The value; may be an expression. |
{
"type": "set",
"path": "state.value"
}toggle
Flips a true/false value in local state. Runs on the device, with no request.
| Field | Type | Required | What it is |
|---|---|---|---|
path | string | yes | State path. |
{
"type": "toggle",
"path": "state.value"
}increment
Adds to a number in local state. Runs on the device, with no request.
| Field | Type | Required | What it is |
|---|---|---|---|
path | string | yes | State path. |
by | number or string or Dynamic | Amount to add; 1 by default. |
{
"type": "increment",
"path": "state.value"
}append
Adds an item to a list in local state. Runs on the device, with no request.
| Field | Type | Required | What it is |
|---|---|---|---|
path | string | yes | State path of the list. |
value | any JSON | The item; may be an expression. |
{
"type": "append",
"path": "state.value"
}remove
Removes an item from a list in local state. Runs on the device, with no request.
| Field | Type | Required | What it is |
|---|---|---|---|
path | string | yes | State path of the list. |
index | number or string or Dynamic | Position to remove; may be an expression such as {{index}}. |
{
"type": "remove",
"path": "state.value"
}openUrl
Opens a link in a new tab. Runs on the device, with no request.
| Field | Type | Required | What it is |
|---|---|---|---|
url | string | yes | Address to open. |
{
"type": "openUrl",
"url": "https://your-app.example/hook"
}copy
Copies text to the clipboard. Runs on the device, with no request.
| Field | Type | Required | What it is |
|---|---|---|---|
text | string | yes | The text. |
{
"type": "copy",
"text": "…"
}toast
Shows a short message. Runs on the device, with no request.
| Field | Type | Required | What it is |
|---|---|---|---|
message | string | yes | The message. |
tone | "default" "success" "danger" | default, success or danger. |
{
"type": "toast",
"message": "…"
}dismiss
Removes this card. Runs on the device, with no request.
No fields.
{
"type": "dismiss"
}