
Live Activities now support a new activity type: stats.
Use stats to track several values at once. It fits up to 8 labeled values, such as revenue, number of users, conversion, uptime, or any metric set you want visible at a glance.
Each item has a label and value. Add an optional color when you want a small visual cue. Leave it out when you want plain text.
const status = await activitysmith.liveActivities.stream("sales-hourly", { content_state: { title: "Sales", subtitle: "last hour", type: "stats", metrics: [ { label: "Revenue", value: "$2430", color: "blue" }, { label: "Orders", value: "37", color: "green" }, { label: "Conversion", value: "4.8%", color: "magenta" }, { label: "Avg Order", value: "$65.68", color: "yellow" }, { label: "Refunds", value: "$84", color: "red" }, { label: "New Buyers", value: "18", color: "cyan" }, ], },});Call the same PUT /live-activity/stream/{stream_key} endpoint again whenever the values change. ActivitySmith keeps the Live Activity in sync on the device for you.
When the stats are no longer relevant, call DELETE /live-activity/stream/{stream_key} to end the Live Activity.
Stats Live Activities can include the same optional action button as other Live Activity types. Use it to open the dashboard or report behind the numbers.
Set the action title to Dashboard, use open_url, and provide an HTTPS URL.

const status = await activitysmith.liveActivities.stream("sales-hourly", { content_state: { title: "Sales", subtitle: "last hour", type: "stats", metrics: [ { label: "Revenue", value: "$2430", color: "blue" }, { label: "Orders", value: "37", color: "green" }, { label: "Conversion", value: "4.8%", color: "magenta" }, { label: "Avg Order", value: "$65.68", color: "yellow" }, { label: "Refunds", value: "$84", color: "red" }, { label: "New Buyers", value: "18", color: "cyan" }, ], }, action: { title: "Dashboard", type: "open_url", url: "https://analytics.example.com/sales", },});Available now across the API, SDKs, and CLI.
This feature is available in the ActivitySmith iOS app version 1.8.0 and newer.