Does it allowed to access external server from shopify functions

AndreyZienko
Shopify Partner
9 0 3

I have additional information about every product on my server, I can access it using app proxy via javascript. Does it allowed to access this information from the shopify functions?
Is there any recommended  libraries for that?

Reply 1 (1)

Nick_Wesselman
Shopify Staff
167 41 64

Shopify functions must be deterministic and execute within 5ms. Enabling external API calls in functions would break these requirements, thus it's not something we support or intend to.

Alternatively, you can place that product information in metafields, or populate it in cart attributes or line item properties. The key is, you need to make the information available ahead of time, before the function executes, and then add it to your input query.

Nick Wesselman | Shopify 
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit the Shopify Help Center or the Shopify Blog