WorkspaceView Markdown ↗
Metadata
Add extra information to your Push Notifications and Live Activities.
Attach details such as a customer ID or job result as metadata. You can view them in ActivitySmith on iOS or the web by opening a Push Notification or Live Activity detail. Metadata does not appear in the Push Notification or Live Activity shown on your Lock Screen.
Add metadata#
Include a top-level metadata object when sending a Push Notification or Live Activity.
await activitysmith.notifications.send({ title: "New subscription", message: "Customer upgraded to Pro plan", metadata: { customer_id: "382", plan: "Pro", amount: 29, trial: false, },});Update or clear metadata#
When updating or ending a Live Activity:
- Omit
metadatato keep the existing fields. - Send a
metadataobject to replace all existing fields. Include every field you want to keep. - Send
"metadata": {}to clear all fields.
These rules apply to managed streams and the legacy start, update, and end endpoints when they update an existing activity.
Supported values and limits#
| Property | Limit |
|---|---|
| Fields | Up to 50 entries |
| Field names | 1 to 100 characters, cannot be blank or __proto__ |
| String values | Up to 4,000 characters |
| Number values | Finite numbers |
| Boolean values | true or false |
| Total size | Up to 16 KB of serialized UTF-8 JSON |
Nested objects, arrays, and null values are not supported.