Doua Beri Doua Beri - 3 years ago 226
Ajax Question

Shopify: get current logged in user ID in JavaScript

I'm trying to build an app for shopify and I'm interested if I can get the current logged user ID using javascript api or something similar.
I was looking at the ajax api: and I can see you can get the current products that the current user has added to his shopping cart, but nothing about the user ID.

Is it possible, or am I missing something?

Answer Source

Your best bet would be to create an App that installs a simple ScriptTag in the shop. That script can then report the customer ID back to the App securely. Very simple to do that. Forget the front-end API as there is no secure way to call your App using that.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download