Push notifications
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.
Property | Type | Description |
---|---|---|
handle | String | Unique text identifier for the topic. |
description | String | The reason for sending the push notification. |
scope | SHOP or PRODUCT | The 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.
Property | Type | Description |
---|---|---|
handle | String | Unique text identifier of the template. |
topic_handle | String | Reference to a notification topic. |
title | String | Template of notification title. |
body | String | Template of notification body, supports interpolation. |
cooldown_minutes | Integer | How 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:
Scope | Variables |
---|---|
SHOP | shop.name |
PRODUCT | shop.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
}
}
}