Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 1.12.0

Adds the new `value` Live Activity type.

## 1.11.0

This version adds support for Metadata and iOS deep links, and expands Tags support when updating or ending Live Activities.
Expand Down
81 changes: 47 additions & 34 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -132,33 +132,42 @@ await activitysmith.notifications.send({

Choose the Live Activity type that matches what you want to show:

![Stats Live Activity with six labeled sales metrics](https://cdn.activitysmith.com/features/stats-live-activity.png)
- ![Value Live Activity showing revenue with a growth badge](https://cdn.activitysmith.com/features/value-live-activity.png) **Value**: Show a single value on your Lock Screen, such as revenue, a queue count, or a temperature.

**Stats**: Show up to 8 labeled values on your Lock Screen, from revenue and orders to uptime and conversion.
- ![Stats Live Activity with six labeled sales metrics](https://cdn.activitysmith.com/features/stats-live-activity.png) **Stats**: Show up to 8 labeled values on your Lock Screen, from revenue and orders to uptime and conversion.

![Metrics Live Activity with CPU and memory values](https://cdn.activitysmith.com/features/metrics-live-activity-start.png)
- ![Alert Live Activity showing a customer reactivation update](https://cdn.activitysmith.com/features/alert-live-activity.png) **Alert**: Show status updates with a clear message, badge, and icon. When you add an action button, `color` controls the button tint.

**Metrics**: Track two related values with segmented bars, such as CPU and memory.
- ![Metrics Live Activity with CPU and memory values](https://cdn.activitysmith.com/features/metrics-live-activity-start.png) **Metrics**: Track two related values with segmented bars, such as CPU and memory.

![Segmented Progress Live Activity showing a workflow step](https://cdn.activitysmith.com/features/update-live-activity.png)
- ![Segmented Progress Live Activity showing a workflow step](https://cdn.activitysmith.com/features/update-live-activity.png) **Segmented Progress**: Show progress through a known set of steps, like build, test, deploy, and verify.

**Segmented Progress**: Show progress through a known set of steps, like build, test, deploy, and verify.
- ![Progress Live Activity showing percentage completion](https://cdn.activitysmith.com/features/progress-live-activity.png) **Progress**: Show percentage progress for jobs that move continuously toward completion.

![Progress Live Activity showing percentage completion](https://cdn.activitysmith.com/features/progress-live-activity.png)
- ![Timer Live Activity showing a benchmark run countdown](https://cdn.activitysmith.com/features/timer-live-activity.png) **Timer**: Count down from a duration, or count up from 00:00 while a job runs.

**Progress**: Show percentage progress for jobs that move continuously toward completion.

![Alert Live Activity showing a customer reactivation update](https://cdn.activitysmith.com/features/alert-live-activity.png)
### Start & Update Live Activity

**Alert**: Show status updates with a clear message, badge, and icon. When you add an action button, `color` controls the button tint.
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.

![Timer Live Activity showing a benchmark run countdown](https://cdn.activitysmith.com/features/timer-live-activity.png)
#### Value

**Timer**: Count down from a duration, or count up from 00:00 while a job runs.
![Value Live Activity stream example](https://cdn.activitysmith.com/features/value-live-activity.png)

### Start & Update Live Activity
```ts
await activitysmith.liveActivities.stream("revenue-today", {
content_state: ActivitySmith.contentState({
title: "Revenue",
type: "value",
value: "$1,240",
color: "green",
icon: ActivitySmith.alertIcon("dollarsign.circle", { color: "green" }),
badge: ActivitySmith.alertBadge("↑ 18%", { color: "purple" }),
}),
});
```

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.
Send a string or number in `value`. Strings keep their formatting, including currency symbols, units, and decimal places.

#### Stats

Expand All @@ -182,6 +191,22 @@ await activitysmith.liveActivities.stream("sales-hourly", {
});
```

#### Alert

![Alert Live Activity stream example](https://cdn.activitysmith.com/features/alert-live-activity.png)

```ts
await activitysmith.liveActivities.stream("customer-ops", {
content_state: ActivitySmith.contentState({
title: "Reactivation",
message: "Lumen came back after 2 weeks",
type: "alert",
icon: ActivitySmith.alertIcon("cloud.sun", { color: "yellow" }),
badge: ActivitySmith.alertBadge("Customer", { color: "magenta" }),
}),
});
```

#### Metrics

![Metrics Live Activity stream example](https://cdn.activitysmith.com/features/metrics-live-activity-start.png)
Expand Down Expand Up @@ -231,22 +256,6 @@ await activitysmith.liveActivities.stream("search-reindex", {
});
```

#### Alert

![Alert Live Activity stream example](https://cdn.activitysmith.com/features/alert-live-activity.png)

```ts
await activitysmith.liveActivities.stream("customer-ops", {
content_state: ActivitySmith.contentState({
title: "Reactivation",
message: "Lumen came back after 2 weeks",
type: "alert",
icon: ActivitySmith.alertIcon("cloud.sun", { color: "yellow" }),
badge: ActivitySmith.alertBadge("Customer", { color: "magenta" }),
}),
});
```

#### Timer

![Timer Live Activity stream example](https://cdn.activitysmith.com/features/timer-live-activity.png)
Expand Down Expand Up @@ -292,7 +301,7 @@ Add more context to Live Activities with icons and badges.

#### Icon

Supported Live Activity types: `stats`, `metrics`, `progress`, `segmented_progress`, `alert`, and `timer`.
Supported Live Activity types: `value`, `stats`, `alert`, `metrics`, `segmented_progress`, `progress`, and `timer`.

![Metrics Live Activity with an SF Symbol icon on the iPhone Lock Screen](https://cdn.activitysmith.com/features/metrics-live-activity-with-icon.png)

Expand All @@ -319,7 +328,7 @@ The `icon.symbol` value is an Apple SF Symbol name. Browse the catalog with one

#### Badge

Badges are supported by `alert`, `progress`, and `segmented_progress` Live Activities.
Badges are supported by `value`, `alert`, `segmented_progress`, and `progress` Live Activities.

![Progress Live Activity with a badge on the iPhone Lock Screen](https://cdn.activitysmith.com/features/progress-live-activity-with-badge.png)

Expand Down Expand Up @@ -427,7 +436,7 @@ await activitysmith.liveActivities.stream("search-reindex", {

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.
The secondary action button is supported for `value`, `alert`, `segmented_progress`, and `progress` Live Activities. Both buttons use the same `open_url`, `webhook`, and Apple Shortcut payload shapes.

```ts
await activitysmith.liveActivities.stream("agent-approval", {
Expand Down Expand Up @@ -604,3 +613,7 @@ try {
### [NPM Package](https://www.npmjs.com/package/activitysmith)

Install the ActivitySmith Node.js SDK from npm

### [Source Code](https://github.com/ActivitySmithHQ/activitysmith-node)

View the Node.js SDK source on GitHub
Loading
Loading