How To Access Custom App API From Theme App Extension in Shopify?
Solution:
You can't, you need to create a secure endpoint that will handle requests coming from a frontend (world) and then use JavaScript Fetch API to query that endpoint. That includes building custom auth for frontend requests and validation logic. So you should end up with creating a theme app block that will contain<script>
tags with your fetch request in it.
By the way, /api/auth is usually used to handle OAuth 2.0 during app installation process, so you won't be able to do anything related to what you want to achieve with it.
Source
Didn't find the answer?
Our community is visited by hundreds of Shopify development professionals every day. Ask your question and get a quick answer for free.
Similar questions
Find the answer in similar questions on our website.
Write quick answer
Do you know the answer to this question? Write a quick response to it. With your help, we will make our community stronger.