activitysmith 1.15.0 → 1.17.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -142,7 +142,7 @@ await activitysmith.notifications.send({
142
142
  });
143
143
  ```
144
144
 
145
- ### Push Notification Interruption Levels
145
+ ### Interruption Levels
146
146
 
147
147
  ![Time Sensitive Push Notification](https://cdn.activitysmith.com/features/time-sensitive-push-notifications.png)
148
148
 
@@ -190,6 +190,26 @@ await activitysmith.notifications.send({
190
190
  });
191
191
  ```
192
192
 
193
+ ### Push Notification Sounds
194
+
195
+ Use `sound` to choose the sound a Push Notification plays. Omit it to play the Push Notifications sound picked in the ActivitySmith app under Settings > Sounds.
196
+
197
+ | Value | Behavior |
198
+ | --- | --- |
199
+ | `default` | Plays the sound picked on the device. This is the same as omitting `sound`. |
200
+ | `none` | Plays no sound. |
201
+ | A sound name | Plays one of the sounds bundled with the app: `arrive`, `bell`, `bells`, `bitflip`, `bloom`, `callout`, `chime`, `coin`, `corrupt`, `crest`, `cue`, `ding`, `drop`, `ember`, `emblem`, `flourish`, `glimmer`, `glint`, `glitch`, `lantern`, `nightfall`, `nudge`, `pixel`, `pop`, `signal`, `streak`, `tally`, `wand`, `whoosh`, or `zip`. |
202
+
203
+ Passive Push Notifications play no sound.
204
+
205
+ ```js
206
+ await activitysmith.notifications.send({
207
+ title: "💸 New sale",
208
+ message: "Pro plan, $29/month",
209
+ sound: "coin",
210
+ });
211
+ ```
212
+
193
213
  ### Replace a Push Notification
194
214
 
195
215
  Every send returns a `notification_id`. Pass it to `replace` to update a Push Notification you already sent, for example when an incident you alerted on is resolved. The replacement takes the old notification's place on the Lock Screen and in history instead of stacking a second one. It arrives silently, without sound or waking the screen, and goes to the same recipients as the original.
@@ -208,6 +228,23 @@ await activitysmith.notifications.replace(sent.notification_id, {
208
228
  });
209
229
  ```
210
230
 
231
+ ### Dismiss a Push Notification
232
+
233
+ Pass the `notification_id` to `dismiss` when a Push Notification no longer needs attention, for example after you answered an agent's question somewhere else.
234
+
235
+ Dismissing clears it from the Lock Screen and Notification Center on every device it was sent to. History keeps it.
236
+
237
+ Devices clear the notification in the background, so it can take a moment.
238
+
239
+ ```js
240
+ const sent = await activitysmith.notifications.send({
241
+ title: "🙋 Agent needs your input",
242
+ message: "Approve the database migration?",
243
+ });
244
+
245
+ await activitysmith.notifications.dismiss(sent.notification_id);
246
+ ```
247
+
211
248
  ## Live Activities
212
249
 
213
250
  Choose the Live Activity type that matches what you want to show:
@@ -373,6 +410,20 @@ For a countdown, send `duration_seconds`. You can update `title`, `subtitle`, `c
373
410
 
374
411
  To start at 00:00 and count up, set `counts_down: false` and leave out `duration_seconds`.
375
412
 
413
+ To count down to a set time, send `timer_end_at` instead of `duration_seconds`. If the timer started earlier, also send `timer_start_at`. The progress bar then shows the time already gone.
414
+
415
+ ```ts
416
+ await activitysmith.liveActivities.stream("nightly-backup", {
417
+ content_state: {
418
+ title: "Nightly Backup",
419
+ subtitle: "uploading archive",
420
+ type: "timer",
421
+ timer_start_at: "2026-11-19T01:00:00Z",
422
+ timer_end_at: "2026-11-19T02:00:00Z",
423
+ },
424
+ });
425
+ ```
426
+
376
427
  ### End Live Activity
377
428
 
378
429
  Call `endStream(...)` with the same `streamKey` to dismiss the Live Activity. You can include final values before it is removed. Set `auto_dismiss_seconds` to dismiss it after a delay in seconds, or `auto_dismiss_minutes` for minutes. Use `0` for immediate dismissal. Seconds take precedence if both are set.
@@ -441,27 +492,32 @@ await activitysmith.liveActivities.stream("nightly-database-backup", {
441
492
  });
442
493
  ```
443
494
 
444
- ### Live Activity Colors
495
+ ### Colors
445
496
 
446
497
  Choose from these colors for the Live Activity accent, including progress bars and action buttons, or apply them to an individual icon or badge:
447
498
 
448
499
  `lime`, `green`, `cyan`, `blue`, `purple`, `magenta`, `red`, `orange`, `yellow`, `gray`
449
500
 
450
- ### Live Activity Action
501
+ ### Actions
451
502
 
452
503
  ![Metrics Live Activity with action](https://cdn.activitysmith.com/features/metrics-live-activity-action.png)
453
504
 
454
505
  Live Activities can include an action button.
455
506
 
456
- - `open_url`: Open a web page or run an iOS Shortcut
507
+ - `open_url`: Open a web page, run an iOS Shortcut, or open an app
457
508
  - `webhook`: Trigger a backend GET/POST workflow
458
509
 
459
510
  #### Open URL action
460
511
 
461
- Open a web page or run an iOS Shortcut when someone taps the button. Supported links:
512
+ Open a web page, run an iOS Shortcut, or open an app when someone taps the button. Supported links:
462
513
 
463
514
  - **HTTP/HTTPS:** Web pages, e.g. `https://example.com`
464
515
  - **Shortcuts:** Run Jarvis with `shortcuts://run-shortcut?name=Jarvis` <!-- full-width -->
516
+ - **App deep links:** Installed apps or specific content within them
517
+ - **Spotify:** A track, e.g. `spotify:track:6rqhFgbbKwnb9MLmUQDhG6`
518
+ - **Termius:** `termius://` to open the app
519
+ - **Claude:** `claude://code` to open the Code tab
520
+ - **ChatGPT:** `chatgpt://` to open the app <!-- Verify ChatGPT URL scheme on iOS before publishing -->
465
521
 
466
522
  ```ts
467
523
  await activitysmith.liveActivities.stream("prod-web-1", {
@@ -503,6 +559,27 @@ await activitysmith.liveActivities.stream("prod-web-1", {
503
559
  });
504
560
  ```
505
561
 
562
+ #### End after the tap
563
+
564
+ Set `dismiss_after_action` on an `open_url` button to end the Live Activity when someone taps it. The button opens its link, then the Live Activity ends.
565
+
566
+ ```ts
567
+ await activitysmith.liveActivities.stream("agent-review", {
568
+ content_state: {
569
+ title: "Review Ready",
570
+ message: "Claude finished the checkout refactor.",
571
+ type: "alert",
572
+ color: "green",
573
+ },
574
+ action: {
575
+ title: "Open Claude",
576
+ type: "open_url",
577
+ url: "claude://code",
578
+ dismiss_after_action: true,
579
+ },
580
+ });
581
+ ```
582
+
506
583
  #### Webhook action
507
584
 
508
585
  ```ts
@@ -574,15 +651,31 @@ await activitysmith.liveActivities.stream("agent-approval", {
574
651
  });
575
652
  ```
576
653
 
654
+ ### Live Activity Sounds
655
+
656
+ Starting a Live Activity plays the Live Activities sound picked in the ActivitySmith app. Updates and ends are silent. Set `sound` on a start, update, or end to choose its sound, with the same values as [Push Notification Sounds](#push-notification-sounds). A sound on an update or end plays only while the screen is on. Use it for moments that need attention, such as a failed step.
657
+
658
+ ```ts
659
+ await activitysmith.liveActivities.stream("deploy-api", {
660
+ content_state: {
661
+ title: "Deploying API",
662
+ subtitle: "Step 3 failed",
663
+ type: "segmented_progress",
664
+ number_of_steps: 4,
665
+ current_step: 3,
666
+ color: "red",
667
+ },
668
+ sound: "glitch",
669
+ });
670
+ ```
671
+
577
672
  ## Lock Screen Widgets
578
673
 
579
674
  ![Lock screen widgets](https://cdn.activitysmith.com/features/lock-screen-widgets.png)
580
675
 
581
- ActivitySmith lets you display any value on your Lock Screen with widgets - SaaS metrics, revenue, signups, uptime, habits, or anything else you want to track. Create a metric in the [web app](https://activitysmith.com/app/widgets), then update the metric value using our API, add a widget to your lock screen and it will fetch the latest update automatically.
582
-
583
- ![Create widget metric](https://cdn.activitysmith.com/features/create-widget-metric.png)
676
+ ActivitySmith lets you display any value on your Lock Screen with widgets - SaaS metrics, revenue, signups, uptime, habits, or anything else you want to track. Send a value to a metric key, add a widget to your Lock Screen, and it fetches the latest value automatically.
584
677
 
585
- Use the metric key to update its value.
678
+ Use the metric key to update its value. The first value creates the metric.
586
679
 
587
680
  ```ts
588
681
  await activitysmith.metrics.update("deploy.success_rate", 99.9);
@@ -594,6 +687,24 @@ String metric values work too.
594
687
  await activitysmith.metrics.update("prod.status", "healthy");
595
688
  ```
596
689
 
690
+ ### Create a metric
691
+
692
+ Use `create` to set the label and how widgets show the value, such as currency, percent, or a unit. Omitted fields keep their current values, so you can call it every time your app starts.
693
+
694
+ ```ts
695
+ await activitysmith.metrics.create("mrr", {
696
+ label: "MRR",
697
+ format: "currency",
698
+ currency_code: "USD",
699
+ });
700
+
701
+ await activitysmith.metrics.update("mrr", 12450);
702
+ ```
703
+
704
+ You can also create and edit metrics in the [web app](https://activitysmith.com/app/widgets).
705
+
706
+ ![Create widget metric](https://cdn.activitysmith.com/features/create-widget-metric.png)
707
+
597
708
  ## App Icon Badge
598
709
 
599
710
  ![ActivitySmith app icon with an App Icon Badge](https://cdn.activitysmith.com/features/badge-count.png)
@@ -695,6 +806,26 @@ await activitysmith.badgeCount(3, {
695
806
  });
696
807
  ```
697
808
 
809
+ ## Paired Devices
810
+
811
+ List the iPhones and iPads paired to your account, for example to check that a device is paired before you send. Active devices come first:
812
+
813
+ ```js
814
+ const { devices } = await activitysmith.devices.list();
815
+
816
+ for (const device of devices) {
817
+ console.log(device.device_name, device.system_name, device.is_active);
818
+ }
819
+ ```
820
+
821
+ An empty list means no device is paired. Install ActivitySmith on your iPhone, sign in with the same account, and allow notifications. Channel-scoped API keys cannot list devices.
822
+
823
+ Pass `includeInactive` to also list devices that can no longer receive deliveries:
824
+
825
+ ```js
826
+ await activitysmith.devices.list({ includeInactive: true });
827
+ ```
828
+
698
829
  ## Error Handling
699
830
 
700
831
  SDK calls return promises, so you can wrap API calls with `try/catch`:
@@ -53,12 +53,12 @@ export declare class LiveActivitiesApi extends runtime.BaseAPI {
53
53
  */
54
54
  endLiveActivityStream(requestParameters: EndLiveActivityStreamRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<LiveActivityStreamDeleteResponse>;
55
55
  /**
56
- * 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, segmented_progress, and value Live Activities. Optional tags to organize and filter notification history. On later stream updates, omit tags to keep the current tags, send tags again to replace them, or send an empty array to clear them.
56
+ * 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, and timer_start_at when the timer started earlier, for example to show time already gone in the progress bar. Omit them on later updates to preserve the existing timer window. Use secondary_action for a second button on alert, progress, segmented_progress, and value Live Activities. Optional tags to organize and filter notification history. On later stream updates, omit tags to keep the current tags, send tags again to replace them, or send an empty array to clear them.
57
57
  * Start a new Live Activity or update an existing one
58
58
  */
59
59
  reconcileLiveActivityStreamRaw(requestParameters: ReconcileLiveActivityStreamRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<LiveActivityStreamPutResponse>>;
60
60
  /**
61
- * 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, segmented_progress, and value Live Activities. Optional tags to organize and filter notification history. On later stream updates, omit tags to keep the current tags, send tags again to replace them, or send an empty array to clear them.
61
+ * 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, and timer_start_at when the timer started earlier, for example to show time already gone in the progress bar. Omit them on later updates to preserve the existing timer window. Use secondary_action for a second button on alert, progress, segmented_progress, and value Live Activities. Optional tags to organize and filter notification history. On later stream updates, omit tags to keep the current tags, send tags again to replace them, or send an empty array to clear them.
62
62
  * Start a new Live Activity or update an existing one
63
63
  */
64
64
  reconcileLiveActivityStream(requestParameters: ReconcileLiveActivityStreamRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<LiveActivityStreamPutResponse>;
@@ -90,7 +90,7 @@ class LiveActivitiesApi extends runtime.BaseAPI {
90
90
  return await response.value();
91
91
  }
92
92
  /**
93
- * 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, segmented_progress, and value Live Activities. Optional tags to organize and filter notification history. On later stream updates, omit tags to keep the current tags, send tags again to replace them, or send an empty array to clear them.
93
+ * 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, and timer_start_at when the timer started earlier, for example to show time already gone in the progress bar. Omit them on later updates to preserve the existing timer window. Use secondary_action for a second button on alert, progress, segmented_progress, and value Live Activities. Optional tags to organize and filter notification history. On later stream updates, omit tags to keep the current tags, send tags again to replace them, or send an empty array to clear them.
94
94
  * Start a new Live Activity or update an existing one
95
95
  */
96
96
  async reconcileLiveActivityStreamRaw(requestParameters, initOverrides) {
@@ -120,7 +120,7 @@ class LiveActivitiesApi extends runtime.BaseAPI {
120
120
  return new runtime.JSONApiResponse(response);
121
121
  }
122
122
  /**
123
- * 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, segmented_progress, and value Live Activities. Optional tags to organize and filter notification history. On later stream updates, omit tags to keep the current tags, send tags again to replace them, or send an empty array to clear them.
123
+ * 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, and timer_start_at when the timer started earlier, for example to show time already gone in the progress bar. Omit them on later updates to preserve the existing timer window. Use secondary_action for a second button on alert, progress, segmented_progress, and value Live Activities. Optional tags to organize and filter notification history. On later stream updates, omit tags to keep the current tags, send tags again to replace them, or send an empty array to clear them.
124
124
  * Start a new Live Activity or update an existing one
125
125
  */
126
126
  async reconcileLiveActivityStream(requestParameters, initOverrides) {
@@ -26,12 +26,12 @@ export interface SendPushNotificationRequest {
26
26
  */
27
27
  export declare class PushNotificationsApi extends runtime.BaseAPI {
28
28
  /**
29
- * Clears a Push Notification you already sent from the Lock Screen and Notification Center on every device it was sent to, using the `notification_id` from the send response. Notification history keeps it. Devices clear the notification in the background, which can take a moment or wait until the ActivitySmith app next opens. A successful response means the dismissal was recorded, not that every device has cleared it yet. Devices running an ActivitySmith app version before 1.17.0 show a silent notification titled \"Push Notification dismissed\" in its place until the user clears it. Calling this again for the same notification returns the same response and sends nothing. A dismissed notification cannot be replaced.
29
+ * Clears a Push Notification you already sent from the Lock Screen and Notification Center on every device it was sent to, using the `notification_id` from the send response. Notification history keeps it. Devices clear the notification in the background, which can take a moment or wait until the ActivitySmith app next opens. A successful response means the dismissal was recorded, not that every device has cleared it yet. Calling this again for the same notification returns the same response and sends nothing. A dismissed notification cannot be replaced.
30
30
  * Dismiss a push notification
31
31
  */
32
32
  dismissPushNotificationRaw(requestParameters: DismissPushNotificationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<PushNotificationDismissResponse>>;
33
33
  /**
34
- * Clears a Push Notification you already sent from the Lock Screen and Notification Center on every device it was sent to, using the `notification_id` from the send response. Notification history keeps it. Devices clear the notification in the background, which can take a moment or wait until the ActivitySmith app next opens. A successful response means the dismissal was recorded, not that every device has cleared it yet. Devices running an ActivitySmith app version before 1.17.0 show a silent notification titled \"Push Notification dismissed\" in its place until the user clears it. Calling this again for the same notification returns the same response and sends nothing. A dismissed notification cannot be replaced.
34
+ * Clears a Push Notification you already sent from the Lock Screen and Notification Center on every device it was sent to, using the `notification_id` from the send response. Notification history keeps it. Devices clear the notification in the background, which can take a moment or wait until the ActivitySmith app next opens. A successful response means the dismissal was recorded, not that every device has cleared it yet. Calling this again for the same notification returns the same response and sends nothing. A dismissed notification cannot be replaced.
35
35
  * Dismiss a push notification
36
36
  */
37
37
  dismissPushNotification(requestParameters: DismissPushNotificationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<PushNotificationDismissResponse>;
@@ -20,7 +20,7 @@ const runtime = require("../runtime");
20
20
  */
21
21
  class PushNotificationsApi extends runtime.BaseAPI {
22
22
  /**
23
- * Clears a Push Notification you already sent from the Lock Screen and Notification Center on every device it was sent to, using the `notification_id` from the send response. Notification history keeps it. Devices clear the notification in the background, which can take a moment or wait until the ActivitySmith app next opens. A successful response means the dismissal was recorded, not that every device has cleared it yet. Devices running an ActivitySmith app version before 1.17.0 show a silent notification titled \"Push Notification dismissed\" in its place until the user clears it. Calling this again for the same notification returns the same response and sends nothing. A dismissed notification cannot be replaced.
23
+ * Clears a Push Notification you already sent from the Lock Screen and Notification Center on every device it was sent to, using the `notification_id` from the send response. Notification history keeps it. Devices clear the notification in the background, which can take a moment or wait until the ActivitySmith app next opens. A successful response means the dismissal was recorded, not that every device has cleared it yet. Calling this again for the same notification returns the same response and sends nothing. A dismissed notification cannot be replaced.
24
24
  * Dismiss a push notification
25
25
  */
26
26
  async dismissPushNotificationRaw(requestParameters, initOverrides) {
@@ -45,7 +45,7 @@ class PushNotificationsApi extends runtime.BaseAPI {
45
45
  return new runtime.JSONApiResponse(response);
46
46
  }
47
47
  /**
48
- * Clears a Push Notification you already sent from the Lock Screen and Notification Center on every device it was sent to, using the `notification_id` from the send response. Notification history keeps it. Devices clear the notification in the background, which can take a moment or wait until the ActivitySmith app next opens. A successful response means the dismissal was recorded, not that every device has cleared it yet. Devices running an ActivitySmith app version before 1.17.0 show a silent notification titled \"Push Notification dismissed\" in its place until the user clears it. Calling this again for the same notification returns the same response and sends nothing. A dismissed notification cannot be replaced.
48
+ * Clears a Push Notification you already sent from the Lock Screen and Notification Center on every device it was sent to, using the `notification_id` from the send response. Notification history keeps it. Devices clear the notification in the background, which can take a moment or wait until the ActivitySmith app next opens. A successful response means the dismissal was recorded, not that every device has cleared it yet. Calling this again for the same notification returns the same response and sends nothing. A dismissed notification cannot be replaced.
49
49
  * Dismiss a push notification
50
50
  */
51
51
  async dismissPushNotification(requestParameters, initOverrides) {
@@ -645,13 +645,13 @@ export declare const ContentStateEndStepColorsEnum: {
645
645
  };
646
646
  export type ContentStateEndStepColorsEnum = typeof ContentStateEndStepColorsEnum[keyof typeof ContentStateEndStepColorsEnum];
647
647
  /**
648
- * Start payload requires title and type. For segmented_progress include number_of_steps and current_step. For progress include percentage or value with upper_limit. For metrics and stats include a non-empty metrics array. For value include a string or number in value; strings preserve currency, units, and other formatting. For alert include message. For timer include duration_seconds for countdowns, or set counts_down false without duration_seconds for an open-ended elapsed timer. Optional icon is supported by all Live Activity types. Optional badge is supported by alert, progress, segmented_progress, and value. For segmented_progress, number_of_steps is not locked and can be changed in later update or end calls.
648
+ * Start payload requires title and type. For segmented_progress include number_of_steps and current_step. For progress include percentage or value with upper_limit. For metrics and stats include a non-empty metrics array. For value include a string or number in value; strings preserve currency, units, and other formatting. For alert include message. For timer include duration_seconds or timer_end_at for countdowns, or set counts_down false without them for an open-ended elapsed timer. Add timer_start_at for a timer that started earlier. Optional icon is supported by all Live Activity types. Optional badge is supported by alert, progress, segmented_progress, and value. For segmented_progress, number_of_steps is not locked and can be changed in later update or end calls.
649
649
  * @export
650
650
  * @interface ContentStateStart
651
651
  */
652
652
  export interface ContentStateStart {
653
653
  /**
654
- *
654
+ * Title shown on the Live Activity. Send an empty string to show no title.
655
655
  * @type {string}
656
656
  * @memberof ContentStateStart
657
657
  */
@@ -693,11 +693,23 @@ export interface ContentStateStart {
693
693
  */
694
694
  upper_limit?: number;
695
695
  /**
696
- * Timer duration in seconds. For type=timer countdowns, required on start when counts_down is true or omitted.
696
+ * Timer duration in seconds. For type=timer countdowns, required on start when counts_down is true or omitted, unless you send timer_end_at. Counts from timer_start_at when you send it.
697
697
  * @type {number}
698
698
  * @memberof ContentStateStart
699
699
  */
700
700
  duration_seconds?: number;
701
+ /**
702
+ * Use with type=timer. ISO 8601 date and time when the timer started. It can be in the past, so a countdown that started earlier shows the time already gone in its progress bar. Defaults to the request time. Must not be in the future.
703
+ * @type {string}
704
+ * @memberof ContentStateStart
705
+ */
706
+ timer_start_at?: string;
707
+ /**
708
+ * Use with type=timer. ISO 8601 date and time when the countdown ends. Must be after timer_start_at, or in the future when timer_start_at is omitted. Send duration_seconds or timer_end_at, not both.
709
+ * @type {string}
710
+ * @memberof ContentStateStart
711
+ */
712
+ timer_end_at?: string;
701
713
  /**
702
714
  * Use with type=timer. When true or omitted, the timer counts down from duration_seconds. Set false for an elapsed timer; omit duration_seconds for an open-ended elapsed timer.
703
715
  * @type {boolean}
@@ -827,7 +839,7 @@ export type ContentStateStartStepColorsEnum = typeof ContentStateStartStepColors
827
839
  */
828
840
  export interface ContentStateUpdate {
829
841
  /**
830
- *
842
+ * Title shown on the Live Activity. Send an empty string to show no title.
831
843
  * @type {string}
832
844
  * @memberof ContentStateUpdate
833
845
  */
@@ -869,11 +881,23 @@ export interface ContentStateUpdate {
869
881
  */
870
882
  upper_limit?: number;
871
883
  /**
872
- * Timer duration in seconds. For type=timer, sending duration_seconds resets the timer window from the update request time; omit it to preserve the existing timer window.
884
+ * Timer duration in seconds. For type=timer, sending duration_seconds resets the timer window from the update request time, or from timer_start_at when you send it. Omit it to preserve the existing timer window.
873
885
  * @type {number}
874
886
  * @memberof ContentStateUpdate
875
887
  */
876
888
  duration_seconds?: number;
889
+ /**
890
+ * Use with type=timer. ISO 8601 date and time when the timer started. It can be in the past, so a countdown that started earlier shows the time already gone in its progress bar. Defaults to the request time. Must not be in the future.
891
+ * @type {string}
892
+ * @memberof ContentStateUpdate
893
+ */
894
+ timer_start_at?: string;
895
+ /**
896
+ * Use with type=timer. ISO 8601 date and time when the countdown ends. Must be after timer_start_at, or in the future when timer_start_at is omitted. Send duration_seconds or timer_end_at, not both. Send timer_end_at alone to move the end and keep the current start.
897
+ * @type {string}
898
+ * @memberof ContentStateUpdate
899
+ */
900
+ timer_end_at?: string;
877
901
  /**
878
902
  * Use with type=timer. When true or omitted, the timer counts down from duration_seconds. Set false for an elapsed timer; omit duration_seconds for an open-ended elapsed timer.
879
903
  * @type {boolean}
@@ -1035,11 +1059,17 @@ export interface LiveActivityAction {
1035
1059
  */
1036
1060
  type: LiveActivityActionType;
1037
1061
  /**
1038
- * Action URL. For open_url, use an HTTP or HTTPS URL or a shortcuts://run-shortcut?name=... URL that runs a specific iPhone Shortcut. For webhook, use an HTTPS URL called by the ActivitySmith backend.
1062
+ * Action URL. For open_url, use an HTTP or HTTPS URL, a shortcuts://run-shortcut?name=... URL that runs a specific iPhone Shortcut, or an installed app's custom URL scheme, such as spotify:// or spotify:track:123. Custom app schemes need the target app installed and have no web fallback. Unsafe schemes and ActivitySmith's own scheme are blocked. For webhook, use an HTTPS URL called by the ActivitySmith backend.
1039
1063
  * @type {string}
1040
1064
  * @memberof LiveActivityAction
1041
1065
  */
1042
1066
  url: string;
1067
+ /**
1068
+ * Ends the Live Activity after the button opens its URL. Used only when type=open_url. Defaults to false.
1069
+ * @type {boolean}
1070
+ * @memberof LiveActivityAction
1071
+ */
1072
+ dismiss_after_action?: boolean;
1043
1073
  /**
1044
1074
  * Webhook HTTP method. Used only when type=webhook.
1045
1075
  * @type {LiveActivityWebhookMethod}
@@ -1156,11 +1186,17 @@ export interface LiveActivityEndRequest {
1156
1186
  */
1157
1187
  action?: LiveActivityAction;
1158
1188
  /**
1159
- * Optional secondary action button. Supported for alert, progress, segmented_progress, and value Live Activities. Uses the same open_url, shortcuts://, and webhook shapes as action.
1189
+ * Optional secondary action button. Supported for alert, progress, segmented_progress, and value Live Activities. Uses the same open_url and webhook shapes as action, including app URL schemes and dismiss_after_action.
1160
1190
  * @type {LiveActivityAction}
1161
1191
  * @memberof LiveActivityEndRequest
1162
1192
  */
1163
1193
  secondary_action?: LiveActivityAction;
1194
+ /**
1195
+ * Optional sound for the end. Ends are silent unless you set one. iOS plays the sound only while the screen is on. Sounds bundled with the ActivitySmith app: `arrive`, `bell`, `bells`, `bitflip`, `bloom`, `callout`, `chime`, `coin`, `corrupt`, `crest`, `cue`, `ding`, `drop`, `ember`, `emblem`, `flourish`, `glimmer`, `glint`, `glitch`, `lantern`, `nightfall`, `nudge`, `pixel`, `pop`, `signal`, `streak`, `tally`, `wand`, `whoosh`, `zip`. Use `default` for the sound picked on the device, or `none` for no sound.
1196
+ * @type {string}
1197
+ * @memberof LiveActivityEndRequest
1198
+ */
1199
+ sound?: string;
1164
1200
  }
1165
1201
  /**
1166
1202
  * Returned after a Live Activity end event is sent or queued.
@@ -1305,7 +1341,7 @@ export interface LiveActivityStartRequest {
1305
1341
  */
1306
1342
  action?: LiveActivityAction;
1307
1343
  /**
1308
- * Optional secondary action button. Supported for alert, progress, segmented_progress, and value Live Activities. Uses the same open_url, shortcuts://, and webhook shapes as action.
1344
+ * Optional secondary action button. Supported for alert, progress, segmented_progress, and value Live Activities. Uses the same open_url and webhook shapes as action, including app URL schemes and dismiss_after_action.
1309
1345
  * @type {LiveActivityAction}
1310
1346
  * @memberof LiveActivityStartRequest
1311
1347
  */
@@ -1328,6 +1364,12 @@ export interface LiveActivityStartRequest {
1328
1364
  * @memberof LiveActivityStartRequest
1329
1365
  */
1330
1366
  tags?: Array<string>;
1367
+ /**
1368
+ * Optional sound for the start. Omit it to play the Live Activities sound picked on the device. Sounds bundled with the ActivitySmith app: `arrive`, `bell`, `bells`, `bitflip`, `bloom`, `callout`, `chime`, `coin`, `corrupt`, `crest`, `cue`, `ding`, `drop`, `ember`, `emblem`, `flourish`, `glimmer`, `glint`, `glitch`, `lantern`, `nightfall`, `nudge`, `pixel`, `pop`, `signal`, `streak`, `tally`, `wand`, `whoosh`, `zip`. Use `default` for the sound picked on the device, or `none` for no sound.
1369
+ * @type {string}
1370
+ * @memberof LiveActivityStartRequest
1371
+ */
1372
+ sound?: string;
1331
1373
  }
1332
1374
  /**
1333
1375
  * Returned after a Live Activity starts. Save activity_id and use it for all later updates and for the final end call.
@@ -1429,7 +1471,7 @@ export interface LiveActivityStreamDeleteRequest {
1429
1471
  */
1430
1472
  action?: LiveActivityAction;
1431
1473
  /**
1432
- * Optional secondary action button. Supported for alert, progress, segmented_progress, and value Live Activities. Uses the same open_url, shortcuts://, and webhook shapes as action.
1474
+ * Optional secondary action button. Supported for alert, progress, segmented_progress, and value Live Activities. Uses the same open_url and webhook shapes as action, including app URL schemes and dismiss_after_action.
1433
1475
  * @type {LiveActivityAction}
1434
1476
  * @memberof LiveActivityStreamDeleteRequest
1435
1477
  */
@@ -1440,6 +1482,12 @@ export interface LiveActivityStreamDeleteRequest {
1440
1482
  * @memberof LiveActivityStreamDeleteRequest
1441
1483
  */
1442
1484
  alert?: AlertPayload;
1485
+ /**
1486
+ * Optional sound for the end. Ends are silent unless you set one. iOS plays the sound only while the screen is on. Sounds bundled with the ActivitySmith app: `arrive`, `bell`, `bells`, `bitflip`, `bloom`, `callout`, `chime`, `coin`, `corrupt`, `crest`, `cue`, `ding`, `drop`, `ember`, `emblem`, `flourish`, `glimmer`, `glint`, `glitch`, `lantern`, `nightfall`, `nudge`, `pixel`, `pop`, `signal`, `streak`, `tally`, `wand`, `whoosh`, `zip`. Use `default` for the sound picked on the device, or `none` for no sound.
1487
+ * @type {string}
1488
+ * @memberof LiveActivityStreamDeleteRequest
1489
+ */
1490
+ sound?: string;
1443
1491
  }
1444
1492
  /**
1445
1493
  * Returned after a managed stream is ended and removed.
@@ -1674,7 +1722,7 @@ export interface LiveActivityStreamRequest {
1674
1722
  */
1675
1723
  action?: LiveActivityAction;
1676
1724
  /**
1677
- * Optional secondary action button. Supported for alert, progress, segmented_progress, and value Live Activities. Uses the same open_url, shortcuts://, and webhook shapes as action.
1725
+ * Optional secondary action button. Supported for alert, progress, segmented_progress, and value Live Activities. Uses the same open_url and webhook shapes as action, including app URL schemes and dismiss_after_action.
1678
1726
  * @type {LiveActivityAction}
1679
1727
  * @memberof LiveActivityStreamRequest
1680
1728
  */
@@ -1703,6 +1751,12 @@ export interface LiveActivityStreamRequest {
1703
1751
  * @memberof LiveActivityStreamRequest
1704
1752
  */
1705
1753
  tags?: Array<string>;
1754
+ /**
1755
+ * Optional sound for this call. A call that starts a Live Activity plays the Live Activities sound picked on the device unless you set one. Updates are silent unless you set one. iOS plays an update sound only while the screen is on. Sounds bundled with the ActivitySmith app: `arrive`, `bell`, `bells`, `bitflip`, `bloom`, `callout`, `chime`, `coin`, `corrupt`, `crest`, `cue`, `ding`, `drop`, `ember`, `emblem`, `flourish`, `glimmer`, `glint`, `glitch`, `lantern`, `nightfall`, `nudge`, `pixel`, `pop`, `signal`, `streak`, `tally`, `wand`, `whoosh`, `zip`. Use `default` for the sound picked on the device, or `none` for no sound.
1756
+ * @type {string}
1757
+ * @memberof LiveActivityStreamRequest
1758
+ */
1759
+ sound?: string;
1706
1760
  }
1707
1761
  /**
1708
1762
  * Update an existing Live Activity by activity_id.
@@ -1743,11 +1797,17 @@ export interface LiveActivityUpdateRequest {
1743
1797
  */
1744
1798
  action?: LiveActivityAction;
1745
1799
  /**
1746
- * Optional secondary action button. Supported for alert, progress, segmented_progress, and value Live Activities. Uses the same open_url, shortcuts://, and webhook shapes as action.
1800
+ * Optional secondary action button. Supported for alert, progress, segmented_progress, and value Live Activities. Uses the same open_url and webhook shapes as action, including app URL schemes and dismiss_after_action.
1747
1801
  * @type {LiveActivityAction}
1748
1802
  * @memberof LiveActivityUpdateRequest
1749
1803
  */
1750
1804
  secondary_action?: LiveActivityAction;
1805
+ /**
1806
+ * Optional sound for this update. Updates are silent unless you set one. iOS plays the sound only while the screen is on. Sounds bundled with the ActivitySmith app: `arrive`, `bell`, `bells`, `bitflip`, `bloom`, `callout`, `chime`, `coin`, `corrupt`, `crest`, `cue`, `ding`, `drop`, `ember`, `emblem`, `flourish`, `glimmer`, `glint`, `glitch`, `lantern`, `nightfall`, `nudge`, `pixel`, `pop`, `signal`, `streak`, `tally`, `wand`, `whoosh`, `zip`. Use `default` for the sound picked on the device, or `none` for no sound.
1807
+ * @type {string}
1808
+ * @memberof LiveActivityUpdateRequest
1809
+ */
1810
+ sound?: string;
1751
1811
  }
1752
1812
  /**
1753
1813
  * Returned after a Live Activity update is sent or queued.
@@ -2159,7 +2219,7 @@ export interface PushNotificationAction {
2159
2219
  */
2160
2220
  type: PushNotificationActionType;
2161
2221
  /**
2162
- * Action URL. For open_url, use HTTP, HTTPS, Shortcuts, or an installed app’s custom URL scheme, such as spotify:// or spotify:track:123. Custom app schemes require iOS 1.13.4 build 2 or later; no web fallback is provided. Internal and executable schemes are blocked. For webhook, use an HTTPS URL called by the ActivitySmith backend.
2222
+ * Action URL. For open_url, use HTTP, HTTPS, Shortcuts, or an installed app’s custom URL scheme, such as spotify:// or spotify:track:123. Custom app schemes have no web fallback. Internal and executable schemes are blocked. For webhook, use an HTTPS URL called by the ActivitySmith backend.
2163
2223
  * @type {string}
2164
2224
  * @memberof PushNotificationAction
2165
2225
  */
@@ -2257,7 +2317,7 @@ export interface PushNotificationReplaceRequest {
2257
2317
  */
2258
2318
  media?: string;
2259
2319
  /**
2260
- * Optional HTTP, HTTPS, Shortcuts, or installed app URL opened when the user taps the notification body. Custom schemes such as spotify:// and spotify:track:123 require iOS 1.13.4 build 2 or later and an installed handler; no web fallback is provided. Internal and executable schemes are blocked. Overrides the default tap target from media.
2320
+ * Optional HTTP, HTTPS, Shortcuts, or installed app URL opened when the user taps the notification body. Custom schemes such as spotify:// and spotify:track:123 require an installed handler; no web fallback is provided. Internal and executable schemes are blocked. Overrides the default tap target from media.
2261
2321
  * @type {string}
2262
2322
  * @memberof PushNotificationReplaceRequest
2263
2323
  */
@@ -2388,7 +2448,7 @@ export interface PushNotificationRequest {
2388
2448
  */
2389
2449
  media?: string;
2390
2450
  /**
2391
- * Optional HTTP, HTTPS, Shortcuts, or installed app URL opened when the user taps the notification body. Custom schemes such as spotify:// and spotify:track:123 require iOS 1.13.4 build 2 or later and an installed handler; no web fallback is provided. Internal and executable schemes are blocked. Overrides the default tap target from media.
2451
+ * Optional HTTP, HTTPS, Shortcuts, or installed app URL opened when the user taps the notification body. Custom schemes such as spotify:// and spotify:track:123 require an installed handler; no web fallback is provided. Internal and executable schemes are blocked. Overrides the default tap target from media.
2392
2452
  * @type {string}
2393
2453
  * @memberof PushNotificationRequest
2394
2454
  */
@@ -2412,7 +2472,7 @@ export interface PushNotificationRequest {
2412
2472
  */
2413
2473
  badge?: number;
2414
2474
  /**
2415
- *
2475
+ * Optional sound for this Push Notification. Omit it to play the Push Notifications sound picked on the device. Passive Push Notifications play no sound. Sounds bundled with the ActivitySmith app: `arrive`, `bell`, `bells`, `bitflip`, `bloom`, `callout`, `chime`, `coin`, `corrupt`, `crest`, `cue`, `ding`, `drop`, `ember`, `emblem`, `flourish`, `glimmer`, `glint`, `glitch`, `lantern`, `nightfall`, `nudge`, `pixel`, `pop`, `signal`, `streak`, `tally`, `wand`, `whoosh`, `zip`. Use `default` for the sound picked on the device, or `none` for no sound.
2416
2476
  * @type {string}
2417
2477
  * @memberof PushNotificationRequest
2418
2478
  */
@@ -2557,13 +2617,13 @@ export type RateLimitErrorCodeEnum = typeof RateLimitErrorCodeEnum[keyof typeof
2557
2617
  */
2558
2618
  export type SendPushNotification429Response = LiveActivityLimitError | RateLimitError;
2559
2619
  /**
2560
- * Current state for a managed Live Activity stream. Include type on the first PUT, and whenever the stream may need to start a fresh activity. Supports segmented_progress, progress, metrics, stats, alert, timer, and value types. For timer, send duration_seconds to start or reset a bounded timer; omit duration_seconds on later updates to preserve the existing timer window.
2620
+ * Current state for a managed Live Activity stream. Include type on the first PUT, and whenever the stream may need to start a fresh activity. Supports segmented_progress, progress, metrics, stats, alert, timer, and value types. For timer, send duration_seconds or timer_end_at to start or reset a bounded timer, and timer_start_at for a timer that started earlier. Omit them on later updates to preserve the existing timer window.
2561
2621
  * @export
2562
2622
  * @interface StreamContentState
2563
2623
  */
2564
2624
  export interface StreamContentState {
2565
2625
  /**
2566
- *
2626
+ * Title shown on the Live Activity. Send an empty string to show no title.
2567
2627
  * @type {string}
2568
2628
  * @memberof StreamContentState
2569
2629
  */
@@ -2605,11 +2665,23 @@ export interface StreamContentState {
2605
2665
  */
2606
2666
  upper_limit?: number;
2607
2667
  /**
2608
- * Timer duration in seconds. For type=timer, send duration_seconds to start or reset the timer window; omit it on later stream updates to preserve the existing timer window.
2668
+ * Timer duration in seconds. For type=timer, send duration_seconds to start or reset the timer window, counted from timer_start_at when you send it. Omit it on later stream updates to preserve the existing timer window.
2609
2669
  * @type {number}
2610
2670
  * @memberof StreamContentState
2611
2671
  */
2612
2672
  duration_seconds?: number;
2673
+ /**
2674
+ * Use with type=timer. ISO 8601 date and time when the timer started. It can be in the past, so a countdown that started earlier shows the time already gone in its progress bar. Defaults to the request time. Must not be in the future.
2675
+ * @type {string}
2676
+ * @memberof StreamContentState
2677
+ */
2678
+ timer_start_at?: string;
2679
+ /**
2680
+ * Use with type=timer. ISO 8601 date and time when the countdown ends. Must be after timer_start_at, or in the future when timer_start_at is omitted. Send duration_seconds or timer_end_at, not both. On later stream updates, send timer_end_at alone to move the end and keep the current start.
2681
+ * @type {string}
2682
+ * @memberof StreamContentState
2683
+ */
2684
+ timer_end_at?: string;
2613
2685
  /**
2614
2686
  * Use with type=timer. When true or omitted, the timer counts down from duration_seconds. Set false for an elapsed timer; omit duration_seconds for an open-ended elapsed timer.
2615
2687
  * @type {boolean}
@@ -17,7 +17,7 @@ type StartRequestBody = Parameters<LiveActivitiesApi["startLiveActivity"]>[0]["l
17
17
  type UpdateRequestBody = Parameters<LiveActivitiesApi["updateLiveActivity"]>[0]["liveActivityUpdateRequest"];
18
18
  type EndRequestBody = Parameters<LiveActivitiesApi["endLiveActivity"]>[0]["liveActivityEndRequest"];
19
19
  type StreamRequestBody = Parameters<LiveActivitiesApi["reconcileLiveActivityStream"]>[0]["liveActivityStreamRequest"];
20
- type StreamDeleteRequestBody = Parameters<LiveActivitiesApi["endLiveActivityStream"]>[0]["liveActivityStreamDeleteRequest"];
20
+ type StreamDeleteRequestBody = NonNullable<Parameters<LiveActivitiesApi["endLiveActivityStream"]>[0]["liveActivityStreamDeleteRequest"]>;
21
21
  type LiveInitOverrides = Parameters<LiveActivitiesApi["startLiveActivity"]>[1];
22
22
  type MetricUpdateParameters = Parameters<MetricsApi["updateMetricValue"]>[0];
23
23
  type MetricRawParameters = Parameters<MetricsApi["updateMetricValueRaw"]>[0];
@@ -74,6 +74,8 @@ export type LiveActivityContentState = Record<string, unknown> & {
74
74
  color?: string;
75
75
  duration_seconds?: number;
76
76
  counts_down?: boolean;
77
+ timer_start_at?: string;
78
+ timer_end_at?: string;
77
79
  };
78
80
  type LiveActivityAlertIconOptions = {
79
81
  color?: string;
@@ -2,7 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.ActivitySmith = exports.DevicesResource = exports.MetricsResource = exports.LiveActivitiesResource = exports.NotificationsResource = void 0;
4
4
  const index_1 = require("../generated/index");
5
- const SDK_VERSION = "1.15.0";
5
+ const SDK_VERSION = "1.17.0";
6
6
  const SDK_HEADER_NAME = "X-ActivitySmith-SDK";
7
7
  const DEFAULT_SDK_NAME = "node";
8
8
  const SDK_HEADER_VALUE = `${DEFAULT_SDK_NAME}-v${SDK_VERSION}`;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "activitysmith",
3
- "version": "1.15.0",
3
+ "version": "1.17.0",
4
4
  "description": "Official ActivitySmith Node.js SDK",
5
5
  "keywords": [
6
6
  "activitysmith",