Secure WebSocket Support in allowed_sources: What Shopify Developers Need to Know

Shopify now lets apps declare secure WebSocket endpoints in shopify.app.toml. Learn what changed, who’s affected, and how to update your app configuration for seamless real‑time integrations.

Secure WebSocket Support in allowed_sources: What Shopify Developers Need to Know
6 sections

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

  • Open shopify.app.toml in your app’s root directory.
  • Locate the [app] section and find the existing allowed_sources array.
  • Add a new entry for every secure WebSocket endpoint your front‑end code connects to. Remember that each host must be a separate entry even if you already have the same domain listed for HTTPS.
  • Keep the same wildcard syntax if needed (e.g., wss://*.example.com).
  • Ensure you stay under the 30‑entry limit.
  • Commit the change, rebuild the app, and push a new version to the Shopify Partner Dashboard.
  • 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:

  • Open the online‑store preview of a test store where the app is installed.
  • Open the browser console and initiate a WebSocket connection to the declared wss:// host.
  • Confirm that the connection succeeds without CSP or network‑access errors.
  • If the connection fails, revisit the 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

  • ✅ Identify every secure WebSocket endpoint your app uses on the storefront.
  • ✅ Add a distinct wss:// entry for each endpoint in shopify.app.toml.
  • ✅ Verify the 30‑entry limit isn’t exceeded.
  • ✅ Deploy a new app version and run the built‑in validation.
  • ✅ Test connections in a dev store to catch CSP errors early.
  • ✅ Update your README or developer docs to reflect the new network‑access requirement.
  • ✅ Communicate the change to any teammates who maintain the app’s CI pipeline.
  • 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.

    Tags
    Sources

    Related Articles

    New Shopify App Security Protections: What Developers and Merchants Must Do Now

    New Shopify App Security Protections: What Developers and Merchants Must Do Now

    Shopify’s latest app‑security updates introduce auto‑pausing of inactive custom apps, mandatory network‑access declarations, and expiring offline tokens. Learn who’s affected, what’s changing, and the exact steps you need to take before the Dec 8, 2026 and Jan 1, 2027 deadlines.

    December 3, 20265 min
    Edit Manual Order‑Level Discounts Directly During an Order Edit

    Edit Manual Order‑Level Discounts Directly During an Order Edit

    Shopify’s 2027‑01 API now lets apps add, update, and remove manual order‑level discounts while editing an order, giving developers finer control and merchants a smoother discount workflow.

    December 3, 20263 min
    Pull Your App’s Logs Directly in the Terminal with Shopify CLI 5.2

    Pull Your App’s Logs Directly in the Terminal with Shopify CLI 5.2

    Shopify CLI 5.2 adds a powerful shopify app logs command that lets developers and merchants fetch historical webhook, API, and Function logs right from their terminal. Learn what changed, who it affects, and how to start using it today.

    December 2, 20263 min
    marketUpdate Now Respects enabled:false: Drafting Markets with Conditions Made Explicit

    marketUpdate Now Respects enabled:false: Drafting Markets with Conditions Made Explicit

    Shopify’s Admin GraphQL API now treats enabled:false as a draft status for condition‑backed markets. Learn what changed, who’s affected, and how to update your apps to avoid silent failures.

    December 2, 20264 min