You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit f59aa69
Browse filesBrowse the repository at this point in the historyBrowse files
authored
Regenerate from OpenAPI 8798c65e97c3d2e2980d6a9f9c56d681aa66b2df (#45)
* chore: regenerate SDK
* feat: add timer live activity DX wrappers
* docs: sync timer live activity readme
* chore: bump version to 1.7.0
---------
Co-authored-by: activitysmith-bot <activitysmith-bot@users.noreply.github.com>
Co-authored-by: bardonadam <bardon.adam@gmail.com>
-`stats`: best for showing business numbers side by side, such as revenue, sales, new users, conversion, refunds, or any other value you want visible at a glance
145
145
-`metrics`: best for live percentage values that change often, like server CPU, memory usage, disk usage, or error rate
146
146
-`segmented_progress`: best for anything that moves through clear stages, like deployments, onboarding flows, backups, ETL pipelines, migrations, and AI agent runs
147
147
-`progress`: best for tracking real-time progress with percentage, like tasks, backups, migrations, syncs, or uploads
148
148
-`alert`: best for status updates, such as feature adoption, reactivation, onboarding blockers, incidents, escalations, and other operational states
149
+
-`timer`: best for countdowns and elapsed runtime, like benchmark runs, uploads, backups, transcodes, and long-running jobs
alt="Timer Live Activity showing a benchmark run countdown"
283
+
width="680"
284
+
/>
285
+
</p>
286
+
287
+
```python
288
+
activitysmith.live_activities.stream(
289
+
"benchmark-run",
290
+
content_state=content_state(
291
+
title="Benchmark Run",
292
+
subtitle="sampling",
293
+
type="timer",
294
+
duration_seconds=300,
295
+
color="cyan",
296
+
),
297
+
)
298
+
```
299
+
300
+
For a countdown, send `duration_seconds`. You can update `title`, `subtitle`, `color`, or any other visible field as the work changes. Leave `duration_seconds` out unless you want to change the timer.
301
+
302
+
To start at 00:00 and count up, set `counts_down: false` and leave out `duration_seconds`.
303
+
276
304
### End Live Activity
277
305
278
306
Call `end_stream(...)` with the same `stream_key` to dismiss the Live Activity. You can include final values before it is removed. By default, iOS removes the Live Activity after two minutes. Set `auto_dismiss_minutes` to choose a different dismissal time, including `0` for immediate dismissal.
@@ -382,7 +410,7 @@ Add more context to Live Activities with icons and badges.
382
410
383
411
#### Icon
384
412
385
-
Supported Live Activity types: `stats`, `metrics`, `progress`, `segmented_progress`, and `alert`.
413
+
Supported Live Activity types: `stats`, `metrics`, `progress`, `segmented_progress`, `alert`, and `timer`.
386
414
387
415
<palign="center">
388
416
<imgsrc="https://cdn.activitysmith.com/features/metrics-live-activity-with-icon.png"alt="Metrics Live Activity with an SF Symbol icon on the iPhone Lock Screen"width="680" />
0 commit comments