How can we use app API calls in Hydrogen storefronts?

How can we use app API calls in Hydrogen storefronts?

vaibhavrathod
Shopify Partner
16 1 9

Hello Everyone,

 

Que-1) We are using an App proxy for our app API call for the online store sales channel and it's working fine but in the hydrogen sales channel how can we use our app API call? Is there any similar concept available for hydrogen storefronts?


Que-2) How we can access Environment variables in client components we already declare the variable in storefront settings in the Environment variables section but we can't access them on both ends (PUBLIC OR PRIVATE).

 

Please refer attached screenshot for this we already try the below code but it's not working.

e.g.

1) import.meta.env.PRIVATE_FLITS_USER_ID,

2) Oxygen?.env?.PRIVATE_FLITS_USER_ID

 

image.png

Reply 1 (1)

Neli2404
Shopify Partner
13 1 2

@vaibhavrathod Have you figured out how to do Que 1? If so, how did you do it?