- SPA integration best practices – end-to-end tips for mounting Voltax once inside a SPA shell.
- React SPA demo – an app that implements every recommendation from the guide.
The demo app expects to be served from http://react-spa-demo.test:5173/ so that the Voltax embed sees a realistic first-party origin (important for cookies, ads, and analytics that behave differently on localhost). Point that custom hostname at 127.0.0.1 before you start the dev server so the browser can resolve it.
macOS / Linux
- Open
/etc/hostswith elevated privileges, e.g.sudo nano /etc/hosts. - Append this line on its own:
127.0.0.1 react-spa-demo.test. - Save the file, then flush DNS with
sudo dscacheutil -flushcache(macOS) orsudo systemd-resolve --flush-caches(Linux) if needed. - Verify with
ping react-spa-demo.test—it should resolve to127.0.0.1.
Windows
- Open Notepad as Administrator and load
C:\Windows\System32\drivers\etc\hosts(you may need to change the file filter to “All Files”). - Add the same line:
127.0.0.1 react-spa-demo.test. - Save, then run
ipconfig /flushdnsin an elevated Command Prompt or PowerShell session. - Confirm via
ping react-spa-demo.test; the response should come from127.0.0.1.
Once the entry is present you can keep it indefinitely—it simply maps the custom dev domain back to your local machine.
After setting the hosts file, you can now run the project locally using the following commands -
cd react-spa-demo
yarn install
yarn dev