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 metadata to keep the existing fields.
  • Send a metadata object 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#

PropertyLimit
FieldsUp to 50 entries
Field names1 to 100 characters, cannot be blank or __proto__
String valuesUp to 4,000 characters
Number valuesFinite numbers
Boolean valuestrue or false
Total sizeUp to 16 KB of serialized UTF-8 JSON

Nested objects, arrays, and null values are not supported.