I asked a question recently in the Commerce forum, which turned into a chat about JavaScript code and the SS API, so apologies for cross posting but maybe this forum is a better place to ask...
Is it possible to put JavaScript in a code block that will detect whether a customer is signed in and, if so, return their email address? Someone on the other forum said yes using the "User Account API" but I can't find any documentation for that API. They also mentioned the Profiles API which does look like it would allow me to retrieve information about a user but only if I already know the Profile ID, which I don't.
In Settings, Advanced, Code Injection, there's a section at the bottom to inject code into the footer of the order confirmation page after checkout. It lists a bunch of tags I can use in the code which include the user's email address. I was kinda hoping for something like that... are there similar tags I can just drop into JS code in any code block on a SS page?
Some links to appropriate documentation would be great.
Thanks.