I am trying to build two sites that are closely linked to each other. The two sites will be as follows:
- Site 1 → root domain → built using Wordpress
- Site 2 → shop.domain.com → built using Shopify
On the homepage, e.g. xxx.com → when a customer clicks the login button → they will be redirected to shopify page to login → upon successful login → customer will be redirected to the homepage (Wordpress site) where we will need to call an api to retrieve the user information such as email, items in cart etc that is from Shopify.
How can we achieve this setup. Do we have to use oxygen and hydrogen on Shopify or can we skip all these and just maybe save a JWT token on the browser upon shopify login and use that token to call the user information such as wishlist, items in cart and user info from Shopify API?