Provides macros for easily responding to Shopify requests within your Shopifex router.
pipelines
Call the pipelines macro in your router to inject some standard router pipelines into your router module.
These pipelines can be used for responding to webhooks, admin links, proxy requests, and requests to load your app within the Shopify admin.
auth routes
Call the auth_routes macro in your router to inject the standard Shopify app routes which your app will need.
This includes routes for loading the app in Shopfiy the admin, app installation and app updates.
payment routes
Call the payment_routes macro in your router to inject the routes required by the Shopifex PaymentGuard system.
Summary
Functions
Injects the following Shopify router pipelines into your Shopifex application's router.
Generate a live session with the current_shop and session token assigned. All other
options are passed through to live_session.
Functions
Injects the following Shopify router pipelines into your Shopifex application's router.
:shopifex_browser: Same as your normal :browser pipeline, except it calls Shopifex.Plug.LoadInIframe, which removes thex-frame-optionsheader and theframe-ancestors 'self'CSP directive thatput_secure_browser_headerssets.:managed_install: RunsShopifex.Plug.ManagedInstall— verifies Shopify'sid_token, exchanges it for an expiring offline access token, and builds the session. Included inauth_routes/1before:shopify_session.:shopify_session: Verifies the App Bridge session token (id_token), or the legacy install HMAC, and makes session information available via Shopifex.Plug API. No-ops when an earlier:managed_installalready loaded the shop. Also removes iFrame blocking headers so app can render in Shopify admin.:validate_install_hmac: RunsShopifex.Plug.ValidateHmaconly. Used by the legacy OAuth/auth/installand/auth/updateroutes, which verify the query HMAC without loading a shop into the session.:shopify_webhook: Validates Shopify webhook requests HMAC and makes session information available via Shopifex.Plug API.:shopify_proxy: Validates Shopify App proxy requests (signed withsignature, nothmac, andrequire_timestamp: true) viaShopifex.Plug.ValidateHmac, then resolves the shop withShopifex.Plug.LoadProxyShop.:shopify_admin_link: Validates Shopify admin link & bulk action link requests and makes session information available via Shopifex.Plug API. Also removes iFrame blocking headers so app can render in Shopify admin.:shopify_api: Ensures that a valid Shopify App Bridge session token (id_token) is present in the Authorization header. Useful for async requests between your SPA front end and Shopifex backend.:shopifex_api: Alias of:shopify_api(sameShopifex.Plug.ShopifyApiAuthbehind CORS + JSON), under theshopifex_-prefixed name.:shopify_embedded: Sets Content-Security-Policy headers to restrict app loading to within the Shopify admin. Read more: https://shopify.dev/apps/store/security/iframe-protection#embedded-apps
Generate a live session with the current_shop and session token assigned. All other
options are passed through to live_session.