activitysmith 1.3.0 → 1.4.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 +42 -336
- package/dist/generated/apis/LiveActivitiesApi.d.ts +16 -16
- package/dist/generated/apis/LiveActivitiesApi.js +16 -16
- package/dist/generated/models/index.d.ts +154 -8
- package/dist/generated/models/index.js +51 -18
- package/dist/src/ActivitySmith.d.ts +55 -5
- package/dist/src/ActivitySmith.js +24 -3
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -15,12 +15,8 @@ See [API reference](https://activitysmith.com/docs/api-reference/introduction)
|
|
|
15
15
|
- [Rich Push Notifications with Media](#rich-push-notifications-with-media)
|
|
16
16
|
- [Actionable Push Notifications](#actionable-push-notifications)
|
|
17
17
|
- [Live Activities](#live-activities)
|
|
18
|
-
- [
|
|
19
|
-
- [
|
|
20
|
-
- [Stats Type](#stats-type)
|
|
21
|
-
- [Metrics Type](#metrics-type)
|
|
22
|
-
- [Segmented Progress Type](#segmented-progress-type)
|
|
23
|
-
- [Progress Type](#progress-type)
|
|
18
|
+
- [Start & Update Live Activity](#start--update-live-activity)
|
|
19
|
+
- [End Live Activity](#end-live-activity)
|
|
24
20
|
- [Live Activity Action](#live-activity-action)
|
|
25
21
|
- [Channels](#channels)
|
|
26
22
|
- [Widgets](#widgets)
|
|
@@ -130,40 +126,26 @@ await activitysmith.notifications.send({
|
|
|
130
126
|
|
|
131
127
|
## Live Activities
|
|
132
128
|
|
|
133
|
-
|
|
134
|
-
<img src="https://cdn.activitysmith.com/features/metrics-live-activity-action.png" alt="Metrics Live Activity screenshot" width="680" />
|
|
135
|
-
</p>
|
|
136
|
-
|
|
137
|
-
There are four types of Live Activities:
|
|
138
|
-
|
|
139
|
-
- `stats`: best for compact business or product stats like revenue, orders, conversion, and average order value
|
|
140
|
-
- `metrics`: best for live operational stats like server CPU and memory, queue depth, or replica lag
|
|
141
|
-
- `segmented_progress`: best for step-based workflows like deployments, backups, and ETL pipelines
|
|
142
|
-
- `progress`: best for continuous jobs like uploads, reindexes, and long-running migrations tracked as a percentage
|
|
143
|
-
|
|
144
|
-
When working with Live Activities via our API, you have two approaches tailored to different needs. First, the stateless mode is the simplest path - one API call can initiate or update an activity, and another ends it - no state tracking on your side.
|
|
145
|
-
|
|
146
|
-
This is ideal if you want minimal complexity, perfect for automated workflows like cron jobs.
|
|
129
|
+
There are five types of Live Activities:
|
|
147
130
|
|
|
148
|
-
|
|
131
|
+
- `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
|
|
132
|
+
- `metrics`: best for live percentage values that change often, like server CPU, memory usage, disk usage, or error rate
|
|
133
|
+
- `segmented_progress`: best for anything that moves through clear stages, like deployments, onboarding flows, backups, ETL pipelines, migrations, and AI agent runs
|
|
134
|
+
- `progress`: best for tracking real-time progress with percentage, like tasks, backups, migrations, syncs, or uploads
|
|
135
|
+
- `alert`: best for status updates, such as feature adoption, reactivation, onboarding blockers, incidents, escalations, and other operational states
|
|
149
136
|
|
|
150
|
-
|
|
137
|
+
### Start & Update Live Activity
|
|
151
138
|
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
Use a stable `streamKey` to identify the system or workflow you are tracking,
|
|
155
|
-
such as a server, deployment, or build pipeline.
|
|
156
|
-
This is especially useful for cron jobs and other scheduled tasks where you do
|
|
157
|
-
not want to store `activity_id` between runs.
|
|
139
|
+
Use a stable `streamKey` to identify the metric, job, deployment, or system you want to keep visible. The first `stream(...)` call starts the Live Activity. Later calls with the same `streamKey` update it.
|
|
158
140
|
|
|
159
141
|
#### Stats
|
|
160
142
|
|
|
161
143
|
<p align="center">
|
|
162
|
-
<img src="https://cdn.activitysmith.com/features/stats-live-activity.png" alt="Stats stream example" width="680" />
|
|
144
|
+
<img src="https://cdn.activitysmith.com/features/stats-live-activity.png" alt="Stats Live Activity stream example" width="680" />
|
|
163
145
|
</p>
|
|
164
146
|
|
|
165
147
|
```ts
|
|
166
|
-
|
|
148
|
+
await activitysmith.liveActivities.stream("sales-hourly", {
|
|
167
149
|
content_state: {
|
|
168
150
|
title: "Sales",
|
|
169
151
|
subtitle: "last hour",
|
|
@@ -183,11 +165,11 @@ const status = await activitysmith.liveActivities.stream("sales-hourly", {
|
|
|
183
165
|
#### Metrics
|
|
184
166
|
|
|
185
167
|
<p align="center">
|
|
186
|
-
<img src="https://cdn.activitysmith.com/features/metrics-live-activity-start.png" alt="Metrics stream example" width="680" />
|
|
168
|
+
<img src="https://cdn.activitysmith.com/features/metrics-live-activity-start.png" alt="Metrics Live Activity stream example" width="680" />
|
|
187
169
|
</p>
|
|
188
170
|
|
|
189
171
|
```ts
|
|
190
|
-
|
|
172
|
+
await activitysmith.liveActivities.stream("prod-web-1", {
|
|
191
173
|
content_state: {
|
|
192
174
|
title: "Server Health",
|
|
193
175
|
subtitle: "prod-web-1",
|
|
@@ -200,10 +182,10 @@ const status = await activitysmith.liveActivities.stream("prod-web-1", {
|
|
|
200
182
|
});
|
|
201
183
|
```
|
|
202
184
|
|
|
203
|
-
#### Segmented
|
|
185
|
+
#### Segmented Progress
|
|
204
186
|
|
|
205
187
|
<p align="center">
|
|
206
|
-
<img src="https://cdn.activitysmith.com/features/update-live-activity.png" alt="Segmented
|
|
188
|
+
<img src="https://cdn.activitysmith.com/features/update-live-activity.png" alt="Segmented Progress Live Activity stream example" width="680" />
|
|
207
189
|
</p>
|
|
208
190
|
|
|
209
191
|
```ts
|
|
@@ -221,7 +203,7 @@ await activitysmith.liveActivities.stream("nightly-backup", {
|
|
|
221
203
|
#### Progress
|
|
222
204
|
|
|
223
205
|
<p align="center">
|
|
224
|
-
<img src="https://cdn.activitysmith.com/features/progress-live-activity.png" alt="Progress stream example" width="680" />
|
|
206
|
+
<img src="https://cdn.activitysmith.com/features/progress-live-activity.png" alt="Progress Live Activity stream example" width="680" />
|
|
225
207
|
</p>
|
|
226
208
|
|
|
227
209
|
```ts
|
|
@@ -235,183 +217,38 @@ await activitysmith.liveActivities.stream("search-reindex", {
|
|
|
235
217
|
});
|
|
236
218
|
```
|
|
237
219
|
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
#### End a stream
|
|
241
|
-
|
|
242
|
-
Use this when the tracked process is finished and you no longer want the Live
|
|
243
|
-
Activity on devices. `content_state` is optional here; include it if you want
|
|
244
|
-
to end the stream with a final state.
|
|
245
|
-
|
|
246
|
-
```ts
|
|
247
|
-
await activitysmith.liveActivities.endStream("prod-web-1", {
|
|
248
|
-
content_state: {
|
|
249
|
-
title: "Server Health",
|
|
250
|
-
subtitle: "prod-web-1",
|
|
251
|
-
type: "metrics",
|
|
252
|
-
metrics: [
|
|
253
|
-
{ label: "CPU", value: 7, unit: "%" },
|
|
254
|
-
{ label: "MEM", value: 38, unit: "%" },
|
|
255
|
-
],
|
|
256
|
-
},
|
|
257
|
-
});
|
|
258
|
-
```
|
|
259
|
-
|
|
260
|
-
If you later send another `stream(...)` request with the same `streamKey`,
|
|
261
|
-
ActivitySmith starts a new Live Activity for that stream again.
|
|
262
|
-
|
|
263
|
-
Stream responses include an `operation` field:
|
|
264
|
-
|
|
265
|
-
- `started`: ActivitySmith started a new Live Activity for this `streamKey`
|
|
266
|
-
- `updated`: ActivitySmith updated the current Live Activity
|
|
267
|
-
- `rotated`: ActivitySmith ended the previous Live Activity and started a new one
|
|
268
|
-
- `noop`: the incoming state matched the current state, so no update was sent
|
|
269
|
-
- `paused`: the stream is paused, so no Live Activity was started or updated
|
|
270
|
-
- `ended`: returned by `endStream(...)` after the stream is ended
|
|
271
|
-
|
|
272
|
-
### Advanced: Full lifecycle control
|
|
273
|
-
|
|
274
|
-
Use these methods when you want to manage the Live Activity lifecycle yourself:
|
|
275
|
-
|
|
276
|
-
1. Call `activitysmith.liveActivities.start(...)`.
|
|
277
|
-
2. Save the returned `activity_id`.
|
|
278
|
-
3. Call `activitysmith.liveActivities.update(...)` as progress changes.
|
|
279
|
-
4. Call `activitysmith.liveActivities.end(...)` when the work is finished.
|
|
280
|
-
|
|
281
|
-
### Stats Type
|
|
282
|
-
|
|
283
|
-
Keep your key numbers on your Lock Screen. `stats` fits 1 to 8 labeled values,
|
|
284
|
-
such as revenue, orders, conversion, uptime, or any other business metric you
|
|
285
|
-
want visible at a glance. Each metric can use a formatted string or number as
|
|
286
|
-
its `value`. Add `color` to a metric to show an accent dot next to its label;
|
|
287
|
-
omit `color` to show the label without a dot.
|
|
288
|
-
|
|
289
|
-
#### Start
|
|
220
|
+
#### Alert
|
|
290
221
|
|
|
291
222
|
<p align="center">
|
|
292
|
-
<img src="https://cdn.activitysmith.com/features/
|
|
223
|
+
<img src="https://cdn.activitysmith.com/features/alert-live-activity.png" alt="Alert Live Activity stream example" width="680" />
|
|
293
224
|
</p>
|
|
294
225
|
|
|
295
226
|
```ts
|
|
296
|
-
|
|
297
|
-
content_state: {
|
|
298
|
-
title: "
|
|
299
|
-
|
|
300
|
-
type: "
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
{ label: "Conversion", value: "4.8%", color: "magenta" },
|
|
305
|
-
{ label: "Avg Order", value: "$65.68", color: "yellow" },
|
|
306
|
-
{ label: "Refunds", value: "$84", color: "red" },
|
|
307
|
-
{ label: "New Buyers", value: "18", color: "cyan" },
|
|
308
|
-
],
|
|
309
|
-
},
|
|
310
|
-
});
|
|
311
|
-
|
|
312
|
-
const activityId = start.activity_id;
|
|
313
|
-
```
|
|
314
|
-
|
|
315
|
-
#### Update
|
|
316
|
-
|
|
317
|
-
```ts
|
|
318
|
-
await activitysmith.liveActivities.update({
|
|
319
|
-
activity_id: activityId,
|
|
320
|
-
content_state: {
|
|
321
|
-
title: "Sales",
|
|
322
|
-
subtitle: "last hour",
|
|
323
|
-
type: "stats",
|
|
324
|
-
metrics: [
|
|
325
|
-
{ label: "Revenue", value: "$3180", color: "blue" },
|
|
326
|
-
{ label: "Orders", value: "51", color: "green" },
|
|
327
|
-
{ label: "Conversion", value: "5.2%", color: "magenta" },
|
|
328
|
-
{ label: "Avg Order", value: "$62.35", color: "yellow" },
|
|
329
|
-
{ label: "Refunds", value: "$126", color: "red" },
|
|
330
|
-
{ label: "New Buyers", value: "24", color: "cyan" },
|
|
331
|
-
],
|
|
332
|
-
},
|
|
333
|
-
});
|
|
334
|
-
```
|
|
335
|
-
|
|
336
|
-
#### End
|
|
337
|
-
|
|
338
|
-
```ts
|
|
339
|
-
await activitysmith.liveActivities.end({
|
|
340
|
-
activity_id: activityId,
|
|
341
|
-
content_state: {
|
|
342
|
-
title: "Sales",
|
|
343
|
-
subtitle: "last hour",
|
|
344
|
-
type: "stats",
|
|
345
|
-
metrics: [
|
|
346
|
-
{ label: "Revenue", value: "$3460", color: "blue" },
|
|
347
|
-
{ label: "Orders", value: "58", color: "green" },
|
|
348
|
-
{ label: "Conversion", value: "5.4%", color: "magenta" },
|
|
349
|
-
{ label: "Avg Order", value: "$59.66", color: "yellow" },
|
|
350
|
-
{ label: "Refunds", value: "$92", color: "red" },
|
|
351
|
-
{ label: "New Buyers", value: "31", color: "cyan" },
|
|
352
|
-
],
|
|
353
|
-
auto_dismiss_minutes: 2,
|
|
354
|
-
},
|
|
227
|
+
await activitysmith.liveActivities.stream("customer-ops", {
|
|
228
|
+
content_state: ActivitySmith.contentState({
|
|
229
|
+
title: "Reactivation",
|
|
230
|
+
message: "Lumen came back after 2 weeks",
|
|
231
|
+
type: "alert",
|
|
232
|
+
icon: ActivitySmith.alertIcon("cloud.sun", { color: "yellow" }),
|
|
233
|
+
badge: ActivitySmith.alertBadge("Customer", { color: "magenta" }),
|
|
234
|
+
}),
|
|
355
235
|
});
|
|
356
236
|
```
|
|
357
237
|
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
Use `metrics` when you want to keep a small set of live stats visible, such as
|
|
361
|
-
server health, queue pressure, or database load.
|
|
238
|
+
The `icon.symbol` value is an Apple SF Symbol name. Browse the catalog with one of these tools:
|
|
362
239
|
|
|
363
|
-
|
|
240
|
+
- [ActivitySmith app](https://apps.apple.com/us/app/activitysmith/id6752254835) - Open Settings -> SF Symbols to browse 45 hand-picked icons ready to use
|
|
241
|
+
- [SF Symbols](https://developer.apple.com/sf-symbols/) - Apple's official macOS app
|
|
242
|
+
- [Interactful](https://apps.apple.com/app/interactful/id1528095640) - free third-party iOS app listing all SF Symbols under Foundations -> Iconography
|
|
364
243
|
|
|
365
|
-
|
|
366
|
-
<img src="https://cdn.activitysmith.com/features/metrics-live-activity-start.png" alt="Metrics start example" width="680" />
|
|
367
|
-
</p>
|
|
368
|
-
|
|
369
|
-
```ts
|
|
370
|
-
const start = await activitysmith.liveActivities.start({
|
|
371
|
-
content_state: {
|
|
372
|
-
title: "Server Health",
|
|
373
|
-
subtitle: "prod-web-1",
|
|
374
|
-
type: "metrics",
|
|
375
|
-
metrics: [
|
|
376
|
-
{ label: "CPU", value: 9, unit: "%" },
|
|
377
|
-
{ label: "MEM", value: 45, unit: "%" },
|
|
378
|
-
],
|
|
379
|
-
},
|
|
380
|
-
});
|
|
381
|
-
|
|
382
|
-
const activityId = start.activity_id;
|
|
383
|
-
```
|
|
244
|
+
`icon` and `badge` are optional. If you omit either one, that element is not shown in the Live Activity.
|
|
384
245
|
|
|
385
|
-
|
|
246
|
+
### End Live Activity
|
|
386
247
|
|
|
387
|
-
|
|
388
|
-
<img src="https://cdn.activitysmith.com/features/metrics-live-activity-update.png" alt="Metrics update example" width="680" />
|
|
389
|
-
</p>
|
|
248
|
+
Call `endStream(...)` with the same `streamKey` 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.
|
|
390
249
|
|
|
391
250
|
```ts
|
|
392
|
-
await activitysmith.liveActivities.
|
|
393
|
-
activity_id: activityId,
|
|
394
|
-
content_state: {
|
|
395
|
-
title: "Server Health",
|
|
396
|
-
subtitle: "prod-web-1",
|
|
397
|
-
type: "metrics",
|
|
398
|
-
metrics: [
|
|
399
|
-
{ label: "CPU", value: 76, unit: "%" },
|
|
400
|
-
{ label: "MEM", value: 52, unit: "%" },
|
|
401
|
-
],
|
|
402
|
-
},
|
|
403
|
-
});
|
|
404
|
-
```
|
|
405
|
-
|
|
406
|
-
#### End
|
|
407
|
-
|
|
408
|
-
<p align="center">
|
|
409
|
-
<img src="https://cdn.activitysmith.com/features/metrics-live-activity-end.png" alt="Metrics end example" width="680" />
|
|
410
|
-
</p>
|
|
411
|
-
|
|
412
|
-
```ts
|
|
413
|
-
await activitysmith.liveActivities.end({
|
|
414
|
-
activity_id: activityId,
|
|
251
|
+
await activitysmith.liveActivities.endStream("prod-web-1", {
|
|
415
252
|
content_state: {
|
|
416
253
|
title: "Server Health",
|
|
417
254
|
subtitle: "prod-web-1",
|
|
@@ -425,144 +262,19 @@ await activitysmith.liveActivities.end({
|
|
|
425
262
|
});
|
|
426
263
|
```
|
|
427
264
|
|
|
428
|
-
###
|
|
429
|
-
|
|
430
|
-
Use `segmented_progress` for jobs and workflows that move through clear steps or
|
|
431
|
-
phases. It fits jobs like backups, deployments, ETL pipelines, and checklists.
|
|
432
|
-
`number_of_steps` is dynamic, so you can increase or decrease it later if the
|
|
433
|
-
workflow changes.
|
|
434
|
-
|
|
435
|
-
#### Start
|
|
436
|
-
|
|
437
|
-
<p align="center">
|
|
438
|
-
<img src="https://cdn.activitysmith.com/features/start-live-activity.png" alt="Segmented progress start example" width="680" />
|
|
439
|
-
</p>
|
|
440
|
-
|
|
441
|
-
```ts
|
|
442
|
-
const start = await activitysmith.liveActivities.start({
|
|
443
|
-
content_state: {
|
|
444
|
-
title: "Nightly database backup",
|
|
445
|
-
subtitle: "create snapshot",
|
|
446
|
-
number_of_steps: 3,
|
|
447
|
-
current_step: 1,
|
|
448
|
-
type: "segmented_progress",
|
|
449
|
-
color: "yellow",
|
|
450
|
-
},
|
|
451
|
-
});
|
|
452
|
-
|
|
453
|
-
const activityId = start.activity_id;
|
|
454
|
-
```
|
|
455
|
-
|
|
456
|
-
#### Update
|
|
457
|
-
|
|
458
|
-
<p align="center">
|
|
459
|
-
<img src="https://cdn.activitysmith.com/features/update-live-activity.png" alt="Segmented progress update example" width="680" />
|
|
460
|
-
</p>
|
|
461
|
-
|
|
462
|
-
```ts
|
|
463
|
-
await activitysmith.liveActivities.update({
|
|
464
|
-
activity_id: activityId,
|
|
465
|
-
content_state: {
|
|
466
|
-
title: "Nightly database backup",
|
|
467
|
-
subtitle: "upload archive",
|
|
468
|
-
number_of_steps: 3,
|
|
469
|
-
current_step: 2,
|
|
470
|
-
},
|
|
471
|
-
});
|
|
472
|
-
```
|
|
473
|
-
|
|
474
|
-
#### End
|
|
475
|
-
|
|
476
|
-
<p align="center">
|
|
477
|
-
<img src="https://cdn.activitysmith.com/features/end-live-activity.png" alt="Segmented progress end example" width="680" />
|
|
478
|
-
</p>
|
|
479
|
-
|
|
480
|
-
```ts
|
|
481
|
-
await activitysmith.liveActivities.end({
|
|
482
|
-
activity_id: activityId,
|
|
483
|
-
content_state: {
|
|
484
|
-
title: "Nightly database backup",
|
|
485
|
-
subtitle: "verify restore",
|
|
486
|
-
number_of_steps: 3,
|
|
487
|
-
current_step: 3,
|
|
488
|
-
auto_dismiss_minutes: 2,
|
|
489
|
-
},
|
|
490
|
-
});
|
|
491
|
-
```
|
|
492
|
-
|
|
493
|
-
### Progress Type
|
|
494
|
-
|
|
495
|
-
Use `progress` when the state is naturally continuous. It fits charging,
|
|
496
|
-
downloads, sync jobs, uploads, timers, and any flow where a percentage or
|
|
497
|
-
numeric range is the clearest signal.
|
|
498
|
-
|
|
499
|
-
#### Start
|
|
500
|
-
|
|
501
|
-
<p align="center">
|
|
502
|
-
<img src="https://cdn.activitysmith.com/features/progress-live-activity-start.png" alt="Progress start example" width="680" />
|
|
503
|
-
</p>
|
|
504
|
-
|
|
505
|
-
```ts
|
|
506
|
-
const start = await activitysmith.liveActivities.start({
|
|
507
|
-
content_state: {
|
|
508
|
-
title: "EV Charging",
|
|
509
|
-
subtitle: "Added 30 mi range",
|
|
510
|
-
type: "progress",
|
|
511
|
-
percentage: 15,
|
|
512
|
-
color: "lime",
|
|
513
|
-
},
|
|
514
|
-
});
|
|
515
|
-
|
|
516
|
-
const activityId = start.activity_id;
|
|
517
|
-
```
|
|
518
|
-
|
|
519
|
-
#### Update
|
|
520
|
-
|
|
521
|
-
<p align="center">
|
|
522
|
-
<img src="https://cdn.activitysmith.com/features/progress-live-activity-update.png" alt="Progress update example" width="680" />
|
|
523
|
-
</p>
|
|
524
|
-
|
|
525
|
-
```ts
|
|
526
|
-
await activitysmith.liveActivities.update({
|
|
527
|
-
activity_id: activityId,
|
|
528
|
-
content_state: {
|
|
529
|
-
title: "EV Charging",
|
|
530
|
-
subtitle: "Added 120 mi range",
|
|
531
|
-
percentage: 60,
|
|
532
|
-
},
|
|
533
|
-
});
|
|
534
|
-
```
|
|
265
|
+
### Live Activity Action
|
|
535
266
|
|
|
536
|
-
|
|
267
|
+
Live Activities can include one optional action button. Use it to open a URL from the Live Activity or trigger a backend webhook.
|
|
268
|
+
For Alert Live Activities, set `content_state.color` to tint the action button. `icon.color` and `badge.color` only affect the icon and badge.
|
|
537
269
|
|
|
538
270
|
<p align="center">
|
|
539
|
-
<img src="https://cdn.activitysmith.com/features/
|
|
271
|
+
<img src="https://cdn.activitysmith.com/features/live-activity-with-action.png?v=20260319-1" alt="Live Activity with action button" width="680" />
|
|
540
272
|
</p>
|
|
541
273
|
|
|
542
|
-
```ts
|
|
543
|
-
await activitysmith.liveActivities.end({
|
|
544
|
-
activity_id: activityId,
|
|
545
|
-
content_state: {
|
|
546
|
-
title: "EV Charging",
|
|
547
|
-
subtitle: "Added 200 mi range",
|
|
548
|
-
percentage: 100,
|
|
549
|
-
auto_dismiss_minutes: 2,
|
|
550
|
-
},
|
|
551
|
-
});
|
|
552
|
-
```
|
|
553
|
-
|
|
554
|
-
### Live Activity Action
|
|
555
|
-
|
|
556
|
-
Just like Actionable Push Notifications, Live Activities can have a button that opens provided URL in a browser or triggers a webhook. Webhooks are executed by the ActivitySmith backend.
|
|
557
|
-
|
|
558
274
|
#### Open URL action
|
|
559
275
|
|
|
560
|
-
<p align="center">
|
|
561
|
-
<img src="https://cdn.activitysmith.com/features/metrics-live-activity-action.png" alt="Metrics Live Activity with action" width="680" />
|
|
562
|
-
</p>
|
|
563
|
-
|
|
564
276
|
```ts
|
|
565
|
-
|
|
277
|
+
await activitysmith.liveActivities.stream("prod-web-1", {
|
|
566
278
|
content_state: {
|
|
567
279
|
title: "Server Health",
|
|
568
280
|
subtitle: "prod-web-1",
|
|
@@ -578,22 +290,16 @@ const start = await activitysmith.liveActivities.start({
|
|
|
578
290
|
url: "https://ops.example.com/servers/prod-web-1",
|
|
579
291
|
},
|
|
580
292
|
});
|
|
581
|
-
|
|
582
|
-
const activityId = start.activity_id;
|
|
583
293
|
```
|
|
584
294
|
|
|
585
295
|
#### Webhook action
|
|
586
296
|
|
|
587
|
-
<p align="center">
|
|
588
|
-
<img src="https://cdn.activitysmith.com/features/live-activity-with-action.png?v=20260319-1" alt="Live Activity with action" width="680" />
|
|
589
|
-
</p>
|
|
590
|
-
|
|
591
297
|
```ts
|
|
592
|
-
await activitysmith.liveActivities.
|
|
593
|
-
activity_id: activityId,
|
|
298
|
+
await activitysmith.liveActivities.stream("search-reindex", {
|
|
594
299
|
content_state: {
|
|
595
300
|
title: "Reindexing product search",
|
|
596
301
|
subtitle: "Shard 7 of 12",
|
|
302
|
+
type: "segmented_progress",
|
|
597
303
|
number_of_steps: 12,
|
|
598
304
|
current_step: 7,
|
|
599
305
|
},
|
|
@@ -33,13 +33,13 @@ export interface UpdateLiveActivityRequest {
|
|
|
33
33
|
*/
|
|
34
34
|
export declare class LiveActivitiesApi extends runtime.BaseAPI {
|
|
35
35
|
/**
|
|
36
|
-
* Ends a Live Activity and archives its lifecycle. Supports segmented_progress, progress, metrics, and
|
|
37
|
-
* End a Live Activity
|
|
36
|
+
* 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, and alert activity types. For segmented_progress activities, you can send the latest number_of_steps here if the workflow changed after start.
|
|
37
|
+
* End a Live Activity (legacy manual lifecycle)
|
|
38
38
|
*/
|
|
39
39
|
endLiveActivityRaw(requestParameters: EndLiveActivityRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<LiveActivityEndResponse>>;
|
|
40
40
|
/**
|
|
41
|
-
* Ends a Live Activity and archives its lifecycle. Supports segmented_progress, progress, metrics, and
|
|
42
|
-
* End a Live Activity
|
|
41
|
+
* 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, and alert activity types. For segmented_progress activities, you can send the latest number_of_steps here if the workflow changed after start.
|
|
42
|
+
* End a Live Activity (legacy manual lifecycle)
|
|
43
43
|
*/
|
|
44
44
|
endLiveActivity(requestParameters: EndLiveActivityRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<LiveActivityEndResponse>;
|
|
45
45
|
/**
|
|
@@ -53,33 +53,33 @@ export declare class LiveActivitiesApi extends runtime.BaseAPI {
|
|
|
53
53
|
*/
|
|
54
54
|
endLiveActivityStream(requestParameters: EndLiveActivityStreamRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<LiveActivityStreamDeleteResponse>;
|
|
55
55
|
/**
|
|
56
|
-
* Use
|
|
57
|
-
*
|
|
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.
|
|
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
|
|
62
|
-
*
|
|
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.
|
|
62
|
+
* Start a new Live Activity or update an existing one
|
|
63
63
|
*/
|
|
64
64
|
reconcileLiveActivityStream(requestParameters: ReconcileLiveActivityStreamRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<LiveActivityStreamPutResponse>;
|
|
65
65
|
/**
|
|
66
|
-
* Starts a Live Activity on devices matched by API key scope and optional target channels. Supports segmented_progress, progress, metrics, and
|
|
67
|
-
* Start a Live Activity
|
|
66
|
+
* 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, and alert activity types. For segmented_progress activities, number_of_steps can be changed later during update or end calls if the workflow changes.
|
|
67
|
+
* Start a Live Activity (legacy manual lifecycle)
|
|
68
68
|
*/
|
|
69
69
|
startLiveActivityRaw(requestParameters: StartLiveActivityRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<LiveActivityStartResponse>>;
|
|
70
70
|
/**
|
|
71
|
-
* Starts a Live Activity on devices matched by API key scope and optional target channels. Supports segmented_progress, progress, metrics, and
|
|
72
|
-
* Start a Live Activity
|
|
71
|
+
* 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, and alert activity types. For segmented_progress activities, number_of_steps can be changed later during update or end calls if the workflow changes.
|
|
72
|
+
* Start a Live Activity (legacy manual lifecycle)
|
|
73
73
|
*/
|
|
74
74
|
startLiveActivity(requestParameters: StartLiveActivityRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<LiveActivityStartResponse>;
|
|
75
75
|
/**
|
|
76
|
-
* Updates an existing Live Activity. If the per-activity token is not registered yet, the update is queued. Supports segmented_progress, progress, metrics, and
|
|
77
|
-
* Update a Live Activity
|
|
76
|
+
* 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, and alert activity types. For segmented_progress activities, you can increase or decrease number_of_steps here as the workflow changes.
|
|
77
|
+
* Update a Live Activity (legacy manual lifecycle)
|
|
78
78
|
*/
|
|
79
79
|
updateLiveActivityRaw(requestParameters: UpdateLiveActivityRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<LiveActivityUpdateResponse>>;
|
|
80
80
|
/**
|
|
81
|
-
* Updates an existing Live Activity. If the per-activity token is not registered yet, the update is queued. Supports segmented_progress, progress, metrics, and
|
|
82
|
-
* Update a Live Activity
|
|
81
|
+
* 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, and alert activity types. For segmented_progress activities, you can increase or decrease number_of_steps here as the workflow changes.
|
|
82
|
+
* Update a Live Activity (legacy manual lifecycle)
|
|
83
83
|
*/
|
|
84
84
|
updateLiveActivity(requestParameters: UpdateLiveActivityRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<LiveActivityUpdateResponse>;
|
|
85
85
|
}
|
|
@@ -20,8 +20,8 @@ const runtime = require("../runtime");
|
|
|
20
20
|
*/
|
|
21
21
|
class LiveActivitiesApi extends runtime.BaseAPI {
|
|
22
22
|
/**
|
|
23
|
-
* Ends a Live Activity and archives its lifecycle. Supports segmented_progress, progress, metrics, and
|
|
24
|
-
* End a Live Activity
|
|
23
|
+
* 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, and alert activity types. For segmented_progress activities, you can send the latest number_of_steps here if the workflow changed after start.
|
|
24
|
+
* End a Live Activity (legacy manual lifecycle)
|
|
25
25
|
*/
|
|
26
26
|
async endLiveActivityRaw(requestParameters, initOverrides) {
|
|
27
27
|
if (requestParameters['liveActivityEndRequest'] == null) {
|
|
@@ -47,8 +47,8 @@ class LiveActivitiesApi extends runtime.BaseAPI {
|
|
|
47
47
|
return new runtime.JSONApiResponse(response);
|
|
48
48
|
}
|
|
49
49
|
/**
|
|
50
|
-
* Ends a Live Activity and archives its lifecycle. Supports segmented_progress, progress, metrics, and
|
|
51
|
-
* End a Live Activity
|
|
50
|
+
* 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, and alert activity types. For segmented_progress activities, you can send the latest number_of_steps here if the workflow changed after start.
|
|
51
|
+
* End a Live Activity (legacy manual lifecycle)
|
|
52
52
|
*/
|
|
53
53
|
async endLiveActivity(requestParameters, initOverrides) {
|
|
54
54
|
const response = await this.endLiveActivityRaw(requestParameters, initOverrides);
|
|
@@ -90,8 +90,8 @@ class LiveActivitiesApi extends runtime.BaseAPI {
|
|
|
90
90
|
return await response.value();
|
|
91
91
|
}
|
|
92
92
|
/**
|
|
93
|
-
* Use
|
|
94
|
-
*
|
|
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.
|
|
94
|
+
* Start a new Live Activity or update an existing one
|
|
95
95
|
*/
|
|
96
96
|
async reconcileLiveActivityStreamRaw(requestParameters, initOverrides) {
|
|
97
97
|
if (requestParameters['streamKey'] == null) {
|
|
@@ -120,16 +120,16 @@ class LiveActivitiesApi extends runtime.BaseAPI {
|
|
|
120
120
|
return new runtime.JSONApiResponse(response);
|
|
121
121
|
}
|
|
122
122
|
/**
|
|
123
|
-
* Use
|
|
124
|
-
*
|
|
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.
|
|
124
|
+
* Start a new Live Activity or update an existing one
|
|
125
125
|
*/
|
|
126
126
|
async reconcileLiveActivityStream(requestParameters, initOverrides) {
|
|
127
127
|
const response = await this.reconcileLiveActivityStreamRaw(requestParameters, initOverrides);
|
|
128
128
|
return await response.value();
|
|
129
129
|
}
|
|
130
130
|
/**
|
|
131
|
-
* Starts a Live Activity on devices matched by API key scope and optional target channels. Supports segmented_progress, progress, metrics, and
|
|
132
|
-
* Start a Live Activity
|
|
131
|
+
* 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, and alert activity types. For segmented_progress activities, number_of_steps can be changed later during update or end calls if the workflow changes.
|
|
132
|
+
* Start a Live Activity (legacy manual lifecycle)
|
|
133
133
|
*/
|
|
134
134
|
async startLiveActivityRaw(requestParameters, initOverrides) {
|
|
135
135
|
if (requestParameters['liveActivityStartRequest'] == null) {
|
|
@@ -155,16 +155,16 @@ class LiveActivitiesApi extends runtime.BaseAPI {
|
|
|
155
155
|
return new runtime.JSONApiResponse(response);
|
|
156
156
|
}
|
|
157
157
|
/**
|
|
158
|
-
* Starts a Live Activity on devices matched by API key scope and optional target channels. Supports segmented_progress, progress, metrics, and
|
|
159
|
-
* Start a Live Activity
|
|
158
|
+
* 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, and alert activity types. For segmented_progress activities, number_of_steps can be changed later during update or end calls if the workflow changes.
|
|
159
|
+
* Start a Live Activity (legacy manual lifecycle)
|
|
160
160
|
*/
|
|
161
161
|
async startLiveActivity(requestParameters, initOverrides) {
|
|
162
162
|
const response = await this.startLiveActivityRaw(requestParameters, initOverrides);
|
|
163
163
|
return await response.value();
|
|
164
164
|
}
|
|
165
165
|
/**
|
|
166
|
-
* Updates an existing Live Activity. If the per-activity token is not registered yet, the update is queued. Supports segmented_progress, progress, metrics, and
|
|
167
|
-
* Update a Live Activity
|
|
166
|
+
* 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, and alert activity types. For segmented_progress activities, you can increase or decrease number_of_steps here as the workflow changes.
|
|
167
|
+
* Update a Live Activity (legacy manual lifecycle)
|
|
168
168
|
*/
|
|
169
169
|
async updateLiveActivityRaw(requestParameters, initOverrides) {
|
|
170
170
|
if (requestParameters['liveActivityUpdateRequest'] == null) {
|
|
@@ -190,8 +190,8 @@ class LiveActivitiesApi extends runtime.BaseAPI {
|
|
|
190
190
|
return new runtime.JSONApiResponse(response);
|
|
191
191
|
}
|
|
192
192
|
/**
|
|
193
|
-
* Updates an existing Live Activity. If the per-activity token is not registered yet, the update is queued. Supports segmented_progress, progress, metrics, and
|
|
194
|
-
* Update a Live Activity
|
|
193
|
+
* 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, and alert activity types. For segmented_progress activities, you can increase or decrease number_of_steps here as the workflow changes.
|
|
194
|
+
* Update a Live Activity (legacy manual lifecycle)
|
|
195
195
|
*/
|
|
196
196
|
async updateLiveActivity(requestParameters, initOverrides) {
|
|
197
197
|
const response = await this.updateLiveActivityRaw(requestParameters, initOverrides);
|