Skip to content

Commit 5870b6e

Browse files
bardonadamclaude
andcommitted
Document dismiss, metrics create, and paired devices in the README
Synced from the landing SDK docs for the 1.15.0 SDK and 1.18.0 CLI releases. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1 parent 0568338 commit 5870b6e

1 file changed

Lines changed: 55 additions & 4 deletions

File tree

‎README.md‎

Lines changed: 55 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,25 @@ from activitysmith import (
2929
activitysmith = ActivitySmith(api_key=os.environ["ACTIVITYSMITH_API_KEY"])
3030
```
3131

32+
## Paired Devices
33+
34+
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:
35+
36+
```python
37+
result = activitysmith.devices.list()
38+
39+
for device in result.devices:
40+
print(device.device_name, device.system_name, device.is_active)
41+
```
42+
43+
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.
44+
45+
Pass `include_inactive` to also list devices that can no longer receive deliveries:
46+
47+
```python
48+
activitysmith.devices.list(include_inactive=True)
49+
```
50+
3251
## Push Notifications
3352

3453
### Send a Push Notification
@@ -215,6 +234,21 @@ activitysmith.notifications.replace(
215234
)
216235
```
217236

237+
### Dismiss a Push Notification
238+
239+
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. Dismissing clears it from the Lock Screen and Notification Center on every device it was sent to. History keeps it.
240+
241+
Devices clear the notification in the background, so it can take a moment.
242+
243+
```python
244+
sent = activitysmith.notifications.send(
245+
title="🙋 Agent needs your input",
246+
message="Approve the database migration?",
247+
)
248+
249+
activitysmith.notifications.dismiss(sent.notification_id)
250+
```
251+
218252
## Live Activities
219253

220254
Choose the Live Activity type that matches what you want to show:
@@ -593,11 +627,9 @@ activitysmith.live_activities.stream(
593627

594628
![Lock screen widgets](https://cdn.activitysmith.com/features/lock-screen-widgets.png)
595629

596-
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.
630+
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.
597631

598-
![Create widget metric](https://cdn.activitysmith.com/features/create-widget-metric.png)
599-
600-
Use the metric key to update its value.
632+
Use the metric key to update its value. The first value creates the metric.
601633

602634
```python
603635
activitysmith.metrics.update("deploy.success_rate", 99.9)
@@ -609,6 +641,25 @@ String metric values work too.
609641
activitysmith.metrics.update("prod.status", "healthy")
610642
```
611643

644+
### Create a metric
645+
646+
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.
647+
648+
```python
649+
activitysmith.metrics.create(
650+
"mrr",
651+
label="MRR",
652+
format="currency",
653+
currency_code="USD",
654+
)
655+
656+
activitysmith.metrics.update("mrr", 12450)
657+
```
658+
659+
You can also create and edit metrics in the [web app](https://activitysmith.com/app/widgets).
660+
661+
![Create widget metric](https://cdn.activitysmith.com/features/create-widget-metric.png)
662+
612663
## App Icon Badge
613664

614665
![ActivitySmith app icon with an App Icon Badge](https://cdn.activitysmith.com/features/badge-count.png)

0 commit comments

Comments
 (0)