Shopify’s latest developer changelog expands the allowed_sources declaration to accept secure WebSocket URLs (wss://). If your app relies on real‑time communication—think live inventory sync, order notifications, or custom storefront widgets—this update unlocks a smoother, more secure integration path. In this post we’ll break down exactly what changed, who needs to act, and the steps to get your app compliant and ready for production.
What Changed
Previously, the allowed_sources section in shopify.app.toml only accepted HTTPS origins. Developers could list up to 30 domains, use sub‑domain wildcards, and specify ports, but any WebSocket traffic had to go through an HTTPS endpoint or be blocked by Shopify’s network policy. The new update adds support for secure WebSocket origins (wss://) while keeping the same formatting rules and limits. In short, you can now declare a line such as wss://realtime.example.com right alongside your existing https://api.example.com entries. Unencrypted WebSockets (ws://) are still prohibited, preserving the platform’s security standards.
Who Is Affected
The change is developer‑focused. If you’ve built a private or public Shopify app that opens a WebSocket connection from the online store (for example, using the Storefront API, ActionCable, or a custom JavaScript SDK), you must now list each wss:// host in allowed_sources. Merchants won’t see a UI change, but they’ll notice fewer CSP warnings and more reliable real‑time features. Apps that never use WebSockets are unaffected and can remain unchanged.
How to Update Your App Configuration
shopify.app.toml in your app’s root directory.[app] section and find the existing allowed_sources array.wss://*.example.com).Here’s a concrete example:
toml
# shopify.app.toml
[app]
name = "Realtime Inventory Sync"
api_key = "..."
[web]
frontend_url = "https://myapp.com"
[web.allowed_sources]
# Existing HTTPS API endpoints
"https://api.myapp.com"
"https://cdn.myapp.com"
# New secure WebSocket origins
"wss://ws.myapp.com"
"wss://realtime.example.com"
After updating the TOML file, run shopify app push (or your CI/CD pipeline) to deploy the new version. Shopify will validate the syntax during the push; any malformed URL will cause a build error, so double‑check the scheme and avoid trailing slashes.
Testing Your WebSocket Declarations
Shopify provides a quick validation endpoint. Once your new version is live:
allowed_sources list for typos or missing wildcards.The official “Declare your app’s network access” documentation also includes a step‑by‑step checklist you can follow.
Action Checklist for Developers
wss:// entry for each endpoint in shopify.app.toml.Conclusion & Next Steps
The addition of secure WebSocket support in allowed_sources removes a long‑standing roadblock for real‑time Shopify apps. By updating your shopify.app.toml and redeploying, you ensure that your customers enjoy fast, live data streams without security warnings. Stay ahead of future changes by regularly reviewing the Shopify Developer Changelog and testing new network configurations in a sandbox store.
Ready to upgrade your app? Open your shopify.app.toml, add the wss:// entries, and push the update today. Need help troubleshooting? Drop a comment below or join the Shopify Developers Slack channel for real‑time assistance.
