Topics covering webhook creation & management, event handling, Pub/Sub, and Eventbridge, in Shopify apps.
Hello.
I'm trying to get customer id of logged in user. I have managed to display the customer id on frontend but i'm clueless as to how i can get it in my app.
I'm using
<script type="text/javascript"> window.customerId = "{{ customer.id }}"; </script>
is there anyway i can send this customer id to my node js app? what do i need to call to get this id? I'm sort of new to shopify app dev
Thank you.
Solved! Go to the solution
This is an accepted solution.
For anyone who is reading, I was able to accomplish this by using 'Theme-app-extention' in my app and added Post request for the customer id using App proxy.
I understand I need to use 'App proxy' to achieve this. I am a little bit confused on how to set up an app proxy and make the call ? I read the documentation https://shopify.dev/apps/online-store/app-proxies#handling-proxy-requests But I'm still not clear on how to do it.
This is an accepted solution.
For anyone who is reading, I was able to accomplish this by using 'Theme-app-extention' in my app and added Post request for the customer id using App proxy.