diff --git a/README.md b/README.md
index 598c82e..bf604c2 100644
--- a/README.md
+++ b/README.md
@@ -286,14 +286,14 @@ await activitysmith.liveActivities.endStream("prod-web-1", {
### Live Activity Action
-Live Activities can include one optional action button.
+Live Activities can include an action button.
- `open_url`: open an HTTPS URL.
-- `open_url` with a `shortcuts://run-shortcut?name=...` URL: run a specific iPhone Shortcut, for example to open an app.
+- `open_url` with a `shortcuts://` URL: run an Apple Shortcut, for example to open an app.
- `webhook`: trigger a backend GET/POST workflow.
-
+
#### Open URL action
@@ -360,6 +360,55 @@ await activitysmith.liveActivities.stream("search-reindex", {
});
```
+#### Secondary action
+
+
+
+
+
+Use `secondary_action` when you want a second button beside the primary `action`.
+
+The secondary action button is supported for `alert`, `progress`, and `segmented_progress` Live Activities. Both buttons use the same `open_url`, `webhook`, and Apple Shortcut payload shapes.
+
+```ts
+await activitysmith.liveActivities.stream("agent-approval", {
+ content_state: {
+ title: "Approval Needed",
+ message: "Should I send the follow-up email to Brightlane?",
+ type: "alert",
+ color: "green",
+ icon: {
+ symbol: "sparkles",
+ color: "green",
+ },
+ badge: {
+ title: "Agent",
+ color: "green",
+ },
+ },
+ action: {
+ title: "Send",
+ type: "webhook",
+ url: "https://agent.example.com/live-activity/approve",
+ method: "POST",
+ body: {
+ approval_id: "approval_01JY3J7Q9S0P8M1V5PZK7DR4M2",
+ decision: "send",
+ },
+ },
+ secondary_action: {
+ title: "Deny",
+ type: "webhook",
+ url: "https://agent.example.com/live-activity/deny",
+ method: "POST",
+ body: {
+ approval_id: "approval_01JY3J7Q9S0P8M1V5PZK7DR4M2",
+ decision: "deny",
+ },
+ },
+});
+```
+
### Icons and Badges
Add more context to Live Activities with icons and badges.
diff --git a/generated/apis/LiveActivitiesApi.ts b/generated/apis/LiveActivitiesApi.ts
index a0ce9ff..cb2d13e 100644
--- a/generated/apis/LiveActivitiesApi.ts
+++ b/generated/apis/LiveActivitiesApi.ts
@@ -61,7 +61,7 @@ export interface UpdateLiveActivityRequest {
export class LiveActivitiesApi extends runtime.BaseAPI {
/**
- * Legacy manual lifecycle endpoint. For new integrations, use DELETE /live-activity/stream/{stream_key} to end a managed Live Activity stream. This endpoint remains supported for existing integrations and advanced lifecycle control. Ends a Live Activity and archives its lifecycle. Supports segmented_progress, progress, metrics, stats, alert, and timer activity types. For segmented_progress activities, you can send the latest number_of_steps here if the workflow changed after start.
+ * Legacy manual lifecycle endpoint. For new integrations, use DELETE /live-activity/stream/{stream_key} to end a managed Live Activity stream. This endpoint remains supported for existing integrations and advanced lifecycle control. Ends a Live Activity and archives its lifecycle. Supports segmented_progress, progress, metrics, stats, alert, and timer activity types. For segmented_progress activities, you can send the latest number_of_steps here if the workflow changed after start. Use secondary_action for a second button on alert, progress, and segmented_progress Live Activities only.
* End a Live Activity (legacy manual lifecycle)
*/
async endLiveActivityRaw(requestParameters: EndLiveActivityRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> {
@@ -98,7 +98,7 @@ export class LiveActivitiesApi extends runtime.BaseAPI {
}
/**
- * Legacy manual lifecycle endpoint. For new integrations, use DELETE /live-activity/stream/{stream_key} to end a managed Live Activity stream. This endpoint remains supported for existing integrations and advanced lifecycle control. Ends a Live Activity and archives its lifecycle. Supports segmented_progress, progress, metrics, stats, alert, and timer activity types. For segmented_progress activities, you can send the latest number_of_steps here if the workflow changed after start.
+ * Legacy manual lifecycle endpoint. For new integrations, use DELETE /live-activity/stream/{stream_key} to end a managed Live Activity stream. This endpoint remains supported for existing integrations and advanced lifecycle control. Ends a Live Activity and archives its lifecycle. Supports segmented_progress, progress, metrics, stats, alert, and timer activity types. For segmented_progress activities, you can send the latest number_of_steps here if the workflow changed after start. Use secondary_action for a second button on alert, progress, and segmented_progress Live Activities only.
* End a Live Activity (legacy manual lifecycle)
*/
async endLiveActivity(requestParameters: EndLiveActivityRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise {
@@ -107,7 +107,7 @@ export class LiveActivitiesApi extends runtime.BaseAPI {
}
/**
- * Use this endpoint when the process you are tracking is finished and you no longer want the Live Activity on your devices. ActivitySmith ends the current Live Activity for this stream and dismisses it from devices. If you need direct lifecycle control, use /live-activity/start, /live-activity/update, and /live-activity/end instead.
+ * Use this endpoint when the process you are tracking is finished and you no longer want the Live Activity on your devices. ActivitySmith ends the current Live Activity for this stream and dismisses it from devices. If you need direct lifecycle control, use /live-activity/start, /live-activity/update, and /live-activity/end instead. Use secondary_action for a second button on alert, progress, and segmented_progress Live Activities only.
* End a stream
*/
async endLiveActivityStreamRaw(requestParameters: EndLiveActivityStreamRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> {
@@ -144,7 +144,7 @@ export class LiveActivitiesApi extends runtime.BaseAPI {
}
/**
- * Use this endpoint when the process you are tracking is finished and you no longer want the Live Activity on your devices. ActivitySmith ends the current Live Activity for this stream and dismisses it from devices. If you need direct lifecycle control, use /live-activity/start, /live-activity/update, and /live-activity/end instead.
+ * Use this endpoint when the process you are tracking is finished and you no longer want the Live Activity on your devices. ActivitySmith ends the current Live Activity for this stream and dismisses it from devices. If you need direct lifecycle control, use /live-activity/start, /live-activity/update, and /live-activity/end instead. Use secondary_action for a second button on alert, progress, and segmented_progress Live Activities only.
* End a stream
*/
async endLiveActivityStream(requestParameters: EndLiveActivityStreamRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise {
@@ -153,7 +153,7 @@ export class LiveActivitiesApi extends runtime.BaseAPI {
}
/**
- * Use a stable stream_key for each ongoing thing you want to show as a Live Activity. Send the latest content_state whenever it changes, and ActivitySmith will keep the Live Activity in sync. For timer streams, send duration_seconds to start or reset the timer; omit duration_seconds on later updates to preserve the existing timer window.
+ * Use a stable stream_key for each ongoing thing you want to show as a Live Activity. Send the latest content_state whenever it changes, and ActivitySmith will keep the Live Activity in sync. For timer streams, send duration_seconds to start or reset the timer; omit duration_seconds on later updates to preserve the existing timer window. Use secondary_action for a second button on alert, progress, and segmented_progress Live Activities only.
* Start a new Live Activity or update an existing one
*/
async reconcileLiveActivityStreamRaw(requestParameters: ReconcileLiveActivityStreamRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> {
@@ -197,7 +197,7 @@ export class LiveActivitiesApi extends runtime.BaseAPI {
}
/**
- * Use a stable stream_key for each ongoing thing you want to show as a Live Activity. Send the latest content_state whenever it changes, and ActivitySmith will keep the Live Activity in sync. For timer streams, send duration_seconds to start or reset the timer; omit duration_seconds on later updates to preserve the existing timer window.
+ * Use a stable stream_key for each ongoing thing you want to show as a Live Activity. Send the latest content_state whenever it changes, and ActivitySmith will keep the Live Activity in sync. For timer streams, send duration_seconds to start or reset the timer; omit duration_seconds on later updates to preserve the existing timer window. Use secondary_action for a second button on alert, progress, and segmented_progress Live Activities only.
* Start a new Live Activity or update an existing one
*/
async reconcileLiveActivityStream(requestParameters: ReconcileLiveActivityStreamRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise {
@@ -206,7 +206,7 @@ export class LiveActivitiesApi extends runtime.BaseAPI {
}
/**
- * Legacy manual lifecycle endpoint. For new integrations, use PUT /live-activity/stream/{stream_key} so ActivitySmith can manage start, update, rotation, and end state for you. This endpoint remains supported for existing integrations and advanced lifecycle control. Starts a Live Activity on devices matched by API key scope and optional target channels. Supports segmented_progress, progress, metrics, stats, alert, and timer activity types. For segmented_progress activities, number_of_steps can be changed later during update or end calls if the workflow changes.
+ * Legacy manual lifecycle endpoint. For new integrations, use PUT /live-activity/stream/{stream_key} so ActivitySmith can manage start, update, rotation, and end state for you. This endpoint remains supported for existing integrations and advanced lifecycle control. Starts a Live Activity on devices matched by API key scope and optional target channels. Supports segmented_progress, progress, metrics, stats, alert, and timer activity types. For segmented_progress activities, number_of_steps can be changed later during update or end calls if the workflow changes. Use secondary_action for a second button on alert, progress, and segmented_progress Live Activities only.
* Start a Live Activity (legacy manual lifecycle)
*/
async startLiveActivityRaw(requestParameters: StartLiveActivityRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> {
@@ -243,7 +243,7 @@ export class LiveActivitiesApi extends runtime.BaseAPI {
}
/**
- * Legacy manual lifecycle endpoint. For new integrations, use PUT /live-activity/stream/{stream_key} so ActivitySmith can manage start, update, rotation, and end state for you. This endpoint remains supported for existing integrations and advanced lifecycle control. Starts a Live Activity on devices matched by API key scope and optional target channels. Supports segmented_progress, progress, metrics, stats, alert, and timer activity types. For segmented_progress activities, number_of_steps can be changed later during update or end calls if the workflow changes.
+ * Legacy manual lifecycle endpoint. For new integrations, use PUT /live-activity/stream/{stream_key} so ActivitySmith can manage start, update, rotation, and end state for you. This endpoint remains supported for existing integrations and advanced lifecycle control. Starts a Live Activity on devices matched by API key scope and optional target channels. Supports segmented_progress, progress, metrics, stats, alert, and timer activity types. For segmented_progress activities, number_of_steps can be changed later during update or end calls if the workflow changes. Use secondary_action for a second button on alert, progress, and segmented_progress Live Activities only.
* Start a Live Activity (legacy manual lifecycle)
*/
async startLiveActivity(requestParameters: StartLiveActivityRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise {
@@ -252,7 +252,7 @@ export class LiveActivitiesApi extends runtime.BaseAPI {
}
/**
- * Legacy manual lifecycle endpoint. For new integrations, use PUT /live-activity/stream/{stream_key} so ActivitySmith can manage start, update, rotation, and end state for you. This endpoint remains supported for existing integrations and advanced lifecycle control. Updates an existing Live Activity. If the per-activity token is not registered yet, the update is queued. Supports segmented_progress, progress, metrics, stats, alert, and timer activity types. For segmented_progress activities, you can increase or decrease number_of_steps here as the workflow changes. For timer activities, send duration_seconds only when you want to reset the timer window; omit it to keep the current timer running.
+ * Legacy manual lifecycle endpoint. For new integrations, use PUT /live-activity/stream/{stream_key} so ActivitySmith can manage start, update, rotation, and end state for you. This endpoint remains supported for existing integrations and advanced lifecycle control. Updates an existing Live Activity. If the per-activity token is not registered yet, the update is queued. Supports segmented_progress, progress, metrics, stats, alert, and timer activity types. For segmented_progress activities, you can increase or decrease number_of_steps here as the workflow changes. For timer activities, send duration_seconds only when you want to reset the timer window; omit it to keep the current timer running. Use secondary_action for a second button on alert, progress, and segmented_progress Live Activities only.
* Update a Live Activity (legacy manual lifecycle)
*/
async updateLiveActivityRaw(requestParameters: UpdateLiveActivityRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> {
@@ -289,7 +289,7 @@ export class LiveActivitiesApi extends runtime.BaseAPI {
}
/**
- * Legacy manual lifecycle endpoint. For new integrations, use PUT /live-activity/stream/{stream_key} so ActivitySmith can manage start, update, rotation, and end state for you. This endpoint remains supported for existing integrations and advanced lifecycle control. Updates an existing Live Activity. If the per-activity token is not registered yet, the update is queued. Supports segmented_progress, progress, metrics, stats, alert, and timer activity types. For segmented_progress activities, you can increase or decrease number_of_steps here as the workflow changes. For timer activities, send duration_seconds only when you want to reset the timer window; omit it to keep the current timer running.
+ * Legacy manual lifecycle endpoint. For new integrations, use PUT /live-activity/stream/{stream_key} so ActivitySmith can manage start, update, rotation, and end state for you. This endpoint remains supported for existing integrations and advanced lifecycle control. Updates an existing Live Activity. If the per-activity token is not registered yet, the update is queued. Supports segmented_progress, progress, metrics, stats, alert, and timer activity types. For segmented_progress activities, you can increase or decrease number_of_steps here as the workflow changes. For timer activities, send duration_seconds only when you want to reset the timer window; omit it to keep the current timer running. Use secondary_action for a second button on alert, progress, and segmented_progress Live Activities only.
* Update a Live Activity (legacy manual lifecycle)
*/
async updateLiveActivity(requestParameters: UpdateLiveActivityRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise {
diff --git a/generated/models/index.ts b/generated/models/index.ts
index e65b022..69b9e93 100644
--- a/generated/models/index.ts
+++ b/generated/models/index.ts
@@ -209,7 +209,7 @@ export interface ContentStateEnd {
*/
type?: ContentStateEndTypeEnum;
/**
- * Optional. Accent color for progress, segmented_progress, metrics, and timer Live Activities. For Alert Live Activities, this tints the action button when action is included.
+ * Optional. Accent color for progress, segmented_progress, metrics, and timer Live Activities. For Alert Live Activities, this tints action and secondary_action buttons when included.
* @type {string}
* @memberof ContentStateEnd
*/
@@ -397,7 +397,7 @@ export interface ContentStateStart {
*/
type: ContentStateStartTypeEnum;
/**
- * Optional. Accent color for progress, segmented_progress, metrics, and timer Live Activities. For Alert Live Activities, this tints the action button when action is included.
+ * Optional. Accent color for progress, segmented_progress, metrics, and timer Live Activities. For Alert Live Activities, this tints action and secondary_action buttons when included.
* @type {string}
* @memberof ContentStateStart
*/
@@ -579,7 +579,7 @@ export interface ContentStateUpdate {
*/
type?: ContentStateUpdateTypeEnum;
/**
- * Optional. Accent color for progress, segmented_progress, metrics, and timer Live Activities. For Alert Live Activities, this tints the action button when action is included.
+ * Optional. Accent color for progress, segmented_progress, metrics, and timer Live Activities. For Alert Live Activities, this tints action and secondary_action buttons when included.
* @type {string}
* @memberof ContentStateUpdate
*/
@@ -684,7 +684,7 @@ export interface ForbiddenError {
message: string;
}
/**
- * Optional single action button shown in the Live Activity UI.
+ * Optional action button shown in the Live Activity UI. Use action for the primary button, or secondary_action for a secondary button on alert, progress, and segmented_progress Live Activities.
* @export
* @interface LiveActivityAction
*/
@@ -816,6 +816,12 @@ export interface LiveActivityEndRequest {
* @memberof LiveActivityEndRequest
*/
action?: LiveActivityAction;
+ /**
+ * Optional secondary action button. Supported only for alert, progress, and segmented_progress Live Activities. Uses the same open_url, shortcuts://, and webhook shapes as action.
+ * @type {LiveActivityAction}
+ * @memberof LiveActivityEndRequest
+ */
+ secondary_action?: LiveActivityAction;
}
/**
* Returned after a Live Activity end event is sent or queued.
@@ -906,6 +912,12 @@ export interface LiveActivityStartRequest {
* @memberof LiveActivityStartRequest
*/
action?: LiveActivityAction;
+ /**
+ * Optional secondary action button. Supported only for alert, progress, and segmented_progress Live Activities. Uses the same open_url, shortcuts://, and webhook shapes as action.
+ * @type {LiveActivityAction}
+ * @memberof LiveActivityStartRequest
+ */
+ secondary_action?: LiveActivityAction;
/**
*
* @type {AlertPayload}
@@ -982,6 +994,12 @@ export interface LiveActivityStreamDeleteRequest {
* @memberof LiveActivityStreamDeleteRequest
*/
action?: LiveActivityAction;
+ /**
+ * Optional secondary action button. Supported only for alert, progress, and segmented_progress Live Activities. Uses the same open_url, shortcuts://, and webhook shapes as action.
+ * @type {LiveActivityAction}
+ * @memberof LiveActivityStreamDeleteRequest
+ */
+ secondary_action?: LiveActivityAction;
/**
*
* @type {AlertPayload}
@@ -1150,6 +1168,12 @@ export interface LiveActivityStreamRequest {
* @memberof LiveActivityStreamRequest
*/
action?: LiveActivityAction;
+ /**
+ * Optional secondary action button. Supported only for alert, progress, and segmented_progress Live Activities. Uses the same open_url, shortcuts://, and webhook shapes as action.
+ * @type {LiveActivityAction}
+ * @memberof LiveActivityStreamRequest
+ */
+ secondary_action?: LiveActivityAction;
/**
*
* @type {AlertPayload}
@@ -1194,6 +1218,12 @@ export interface LiveActivityUpdateRequest {
* @memberof LiveActivityUpdateRequest
*/
action?: LiveActivityAction;
+ /**
+ * Optional secondary action button. Supported only for alert, progress, and segmented_progress Live Activities. Uses the same open_url, shortcuts://, and webhook shapes as action.
+ * @type {LiveActivityAction}
+ * @memberof LiveActivityUpdateRequest
+ */
+ secondary_action?: LiveActivityAction;
}
/**
* Returned after a Live Activity update is sent or queued.
@@ -1616,7 +1646,7 @@ export interface StreamContentState {
*/
type?: StreamContentStateTypeEnum;
/**
- * Optional. Accent color for progress, segmented_progress, metrics, and timer Live Activities. For Alert Live Activities, this tints the action button when action is included.
+ * Optional. Accent color for progress, segmented_progress, metrics, and timer Live Activities. For Alert Live Activities, this tints action and secondary_action buttons when included.
* @type {string}
* @memberof StreamContentState
*/
diff --git a/package-lock.json b/package-lock.json
index fff5f06..518baed 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -1,12 +1,12 @@
{
"name": "activitysmith",
- "version": "1.7.0",
+ "version": "1.8.0",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "activitysmith",
- "version": "1.7.0",
+ "version": "1.8.0",
"license": "MIT",
"devDependencies": {
"typescript": "^5.3.3",
diff --git a/package.json b/package.json
index 4eafe5d..ea282fc 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "activitysmith",
- "version": "1.7.0",
+ "version": "1.8.0",
"description": "Official ActivitySmith Node.js SDK",
"keywords": [
"activitysmith",
diff --git a/src/ActivitySmith.ts b/src/ActivitySmith.ts
index 58cbd37..f2aaffe 100644
--- a/src/ActivitySmith.ts
+++ b/src/ActivitySmith.ts
@@ -1,6 +1,6 @@
import { Configuration, PushNotificationsApi, LiveActivitiesApi, MetricsApi } from "../generated/index";
-const SDK_VERSION = "1.7.0";
+const SDK_VERSION = "1.8.0";
const SDK_HEADER_NAME = "X-ActivitySmith-SDK";
const SDK_HEADER_VALUE = `node-v${SDK_VERSION}`;
diff --git a/tests/resources.test.js b/tests/resources.test.js
index 3de51a6..4d88e81 100644
--- a/tests/resources.test.js
+++ b/tests/resources.test.js
@@ -535,6 +535,12 @@ describe("resource wrappers", () => {
type: "open_url",
url: "shortcuts://run-shortcut?name=Deploy%20Status",
},
+ secondary_action: {
+ title: "Deny",
+ type: "webhook",
+ url: "https://ops.example.com/hooks/deploy/deny",
+ method: "POST",
+ },
};
const updatePayload = {
@@ -552,6 +558,11 @@ describe("resource wrappers", () => {
method: "POST",
body: { job_id: "reindex-2026-03-19" },
},
+ secondary_action: {
+ title: "Open Runbook",
+ type: "open_url",
+ url: "https://ops.example.com/runbooks/search-reindex",
+ },
};
const endPayload = {
@@ -567,6 +578,11 @@ describe("resource wrappers", () => {
type: "open_url",
url: "shortcuts://run-shortcut?name=Deploy%20Status",
},
+ secondary_action: {
+ title: "Archive",
+ type: "webhook",
+ url: "https://ops.example.com/hooks/deploy/archive",
+ },
};
await client.liveActivities.start(startPayload);