Skip to content

How can i switch between Multiple Magento2 Websites in PWA Studios?

We use PWA Studios as the “headless” frontend for our B2B website.

We need to create a new website, this time B2C, with a shared magento 2 backend while keeping the same domain in between both websites.

I know Venia/PWA do not offer a website switcher (only store & store view switchers), so i was wondering how to create one myself.

Is the best way to accomplish this to create a storeConfig graphql mutation that changes the current website data to the one chosen by the user:

website_code
website_id
website_name

or is there a better way? Can anyone help?