Briefly explain what’s not working or where you’re stuck
I’ve built a quiz as an HTML iFrame embed in Wix Studio. When a visitor opts in to a mailing list on the results screen, I need their email and a group ID sent to an external email API. Every approach I’ve tried is blocked — either by CORS because the iFrame runs on Wix’s filesusr domain, or by postMessage not reaching the Wix page code on the live site.
Working in
Wix Studio Editor, Dev Mode, Velo backend, Wix Automations
Site link
What I’m trying to do
When a visitor opts in via the quiz, I want their email address and a result group ID to be passed to a Velo backend function, which then calls an external email API to add them to the correct mailing list group.
What I’ve tried so far
- Direct fetch from iFrame to external API — blocked by CORS (origin is Wix’s filesusr domain)
- Direct fetch from iFrame to my Wix HTTP function — also blocked by CORS for the same reason
- postMessage using window.parent and window.top — message never reaches Wix page code on live site; confirmed by Wix Logs showing no entries when opt-in fires
- wix-fetch in page code — runs client-side, same CORS problem
- Importing a backend web.js function into page code and calling it from an onMessage handler — TypeError: (0, e.addSubscriberToGroup) is not a function from comlink.js, tried all import path variations
- Installed the wix automations and wix essentials packages, built a Wix Automation with a Velo code trigger and Run Velo code action — but still cannot get any signal from inside the iFrame to fire it
Extra context
Wix support confirmed the iFrame sandboxing is intentional and cannot be disabled, and suggested moving API calls to a backend — which is exactly what I am trying to do. They also mentioned Wix Blocks as a possible alternative. The Velo backend setup appears correct and the automation is active — the problem is purely that no data can get out of the sandboxed iFrame and into the Wix backend. Is Wix Blocks a realistic solution here, and if so how would I approach it?