Skip to content

Autocode App for sending Shopify Partner API notifications to Slack.

License

Notifications You must be signed in to change notification settings

optizio/shopify-partner-notifications-slack

Repository files navigation

Shopify Partner Event Notifications in Slack

This Autocode app will send notifications to Slack when merchants install and subscribe to your app (as well as when they uninstall and unsubscribe). It does this by polling the partner events API (every 5 minutes by default), and then sends a notification to Slack for each relevant event.

Slack Notifications

How it works

We poll the Shopify Partner API's GraphQL endpoint requesting several relationship (install, uninstall, deactivated, reactivated) and subscription (activated, canceled, frozen, unfrozen) events. We don't get all event types. Some aren't particularly useful, or can be too noisy. We also found 5 minutes to be a reasonable poll interval.

We then loop through the events returned since the last request and post a message to Slack for each one.

A note of the last success is also recorded in Autocode's key/value store so that if you get a transient failure, then the next run will pick up any missed events.

Environment Variables

  • SHOPIFY_PARTNER_API_TOKEN: Shopify Partner API access token, generated from Settings > Partner API Clients > Manage Partner API Clients in the Partner Portal.
  • SLACK_CHANNEL: The channel name to post Slack names to, e.g. #general
  • SHOPIFY_PARTNER_ID: Your Shopify Partner ID. Can be found under Settings > Account Information > Partner ID in the Partner Portal.
  • SHOPIFY_APP_ID: Your Shopify App's ID. Can be found toward the end of the url when on the App's main page in the Partner Portal.

Linked Resources

The app uses the Autocode Slack linked resource to send messages to a connected Slack workspace.

About

Autocode App for sending Shopify Partner API notifications to Slack.

Resources

License

Stars

Watchers

Forks

Packages

No packages published