Hi all,
New Shopify developer here, any help would be much appreciated!
I have written some code directly in my (development) front end Shopify code base which checks for when a customer lands on a product page and when a customer leaves a product page. When a customer lands on the product page, I use Liquid objects to gather data from the product the customer is viewing and then package everything into a variable.
I want to then take this data and send it to some backend code that will make an authenticated external API patch request, with the the product data variable passed into the body of the request.
This second step is where I am having trouble. Since it is such a simple backend function, I tried to set it up an AWS as a Lambda function with an API gateway trigger. I then created a proxy app directly through the shopify partner dashboard and used the API gateway endpoint as the Proxy URL.
I then realised in order to install the proxy app on my development store, I needed to setup a App URL/Redirect URL and an OAuth handler. So I attempted to create another API Gateway endpoint linked to another Lambda set up specifically for handling OAuth callbacks. I used this new API Gateway endpoint as the redirect URL but it still doesn’t seem to be working properly.
My question is - is there a simpler way for me to achieve this? I am thinking a better idea would be to create and host a Shopify app through the Shopify CLI - which seems like it might remove some of the difficulties with the installation/OAuth handling? Or am I on the wrong tracks?
Any suggestions would be very welcome!
Thanks