I am creating an app which is embedded into Shopify Admin. When the app starts up, I want to read the user’s email address, and check whether that email address exists already in my own database. The documentation on the App Bridge makes it seem as though this is possible, but:
-
I am using the package @Shopify_77 /app-bridge-react, which seems inconsistent with this documentation. Perhaps this is not fully-featured?
-
Even when using App Bridge as a CDN resource, the console logged user object in the snippet below, always has undefined for user.email (in fact all properties are undefined or empty apart from accountAccess), despite the fact I am logged into admin.shopify.com.
shopify.user().then((user) => console.log(user));
The second part of this problem is that I would like to store some metafield about the relationship between the Shopify user and my own database on Shopify’s backend. I can’t see that it is possible to store a metafield on the user in this way, however. Is there a different approach I can take, or am I missing something here?