Skip to main content

Push notifications

info

Push notifications are only available to early access partners. Apply here to join the early access program.

Push notifications allow Shop Minis developers to broadcast messages to interested users. Shop Minis that use the EVENT_CARD_V2 entry point can trigger push notifications when an event goes live.

Configuring push notifications

Push notification settings consist of topics and templates. They should be defined in your manifest.json and will be reviewed when you submit your Shop Mini to be published.

Topics

Topics specify the scope and reason for a push notification.

PropertyTypeDescription
handleStringUnique text identifier for the topic.
descriptionStringThe reason for sending the push notification.
scopeSHOP or PRODUCTThe context for the push notification. For example, a live event notification for a particular merchant would be scoped to SHOP and a restock notification might be scoped to PRODUCT.
{
"notification_topics": [
{
"handle": "live-shopping-reminders",
"description": "Notifications about live streaming events for a merchant",
"scope": "SHOP"
}
]
}

Templates

Templates specify the format of the notification that will be sent to users.

PropertyTypeDescription
handleStringUnique text identifier of the template.
topic_handleStringReference to a notification topic.
titleStringTemplate of notification title.
bodyStringTemplate of notification body, supports interpolation.
cooldown_minutesIntegerHow often the template allows to send the exact same message to the same user, in minutes.
{
"notification_templates": [
{
"handle": "live-shopping-reminder_v1",
"topic_handle": "live-shopping-reminders",
"title": "Reminder {{shop.name}} live now",
"body": "Join us for an amazing {{shop.name}} live event!",
"cooldown_minutes": 10080
}
]
}

You can use the following variables in your push notification templates:

ScopeVariables
SHOPshop.name
PRODUCTshop.name, product.name, product.price

Triggering push notifications

Once your push notification configuration has been reviewed and approved, you can trigger push notifications for a particular template and entity using the notificationTrigger mutation in the Shop Minis Admin API.

mutation {
notificationTrigger(
templateHandle: "live-shopping-reminder_v1"
scopedEntityId: "gid://shopify/Shop/123"
shopDomain: "your-store.myshopify.com"
) {
warnings {
code
message
}
userErrors {
message
}
}
}