Development discussions around Shopify APIs
Is it possible to get the current user details (email, full name) with either Shopify Bridge or the EASDK?
The EASDK has a https://help.shopify.com/en/api/embedded-apps/embedded-app-sdk/methods#shopifyapp-user-current method but it only shows the accountAccess so I think the answer is no.
How about Shopify Bridge?
I find the documentation extremely light.
See https://help.shopify.com/en/api/embedded-apps/app-bridge/methods#app-getstate
Hey @ClementBR,
The only 'current user' information available is accountAccess. The shop endpoint might be of interest - it will have the store owner's name and email, but no 'current user' information.
Scott | Developer Support @ Shopify
- Was my reply helpful? Click Like to let me know!
- Was your question answered? Mark it as an Accepted Solution
- To learn more visit Shopify.dev or the Shopify Web Design and Development Blog
I'm aware of the shop's endpoint but it's not what we want.
We need the details of the current user, not the owner.
It's critical so that we can understand which user performed which actions, in particular for security features and to keep a log of activities performed by each user.
It seems like a pretty big oversight of the API.
I also note that the POS SDK has had the feature since the beginning.
Why is it not available in Shopify Bridge?
Would just like to add another vote for this functionality! For an embedded app, it is definitely a user using it, and for being able to report on who made a change inside the app getting the user's identity is super important! Please let us access it!
+1 on this. This is EXACTLY what I'm looking for and what I'm hoping to achieve.
+1 to this, really needs the user details even just an identifier || email so that actions in apps could be audited to a specific user.
This staffMember objects:
staffMember: { accountAccess: "Full access" locale: "en" }
staffMember: { accountAccess: "Limited access" locale: "en" }
Just dosnt quite have enough to actually work with, means we will have a fragile work around including browser or session based state.
So, if you are using per-user OAuth permissions, you're able to get the actual details of the current user from the OAuth dance which is helpful. The API keys granted with that process can't do anything offline though which renders them pretty useless in a lot of scenarios.
I've ended up going with a nasty process of OAuth-ing with offline permissions first to get an API key I can use to do the actual work for the app in the background, and then OAuthing again with per-user permissions to get the details of which user is actually logged into the app. Neither of these actually use the EASDK or the app bridge to do get current user information, but if you have a server you can cooperate with, you can store the current user's details in the session when you complete the per-user OAuth flow and then you have the state you need server side at least.
https://shopify.dev/concepts/about-apis/authentication#api-access-modes actually says this is supported to use the two different modes when appropriate, but its really annoying and error prone to set up. Notably, the user is actually only hits the consent screen once, and otherwise just sees their browser redirecting around like crazy.
It's at least an option!
I haven't had much luck yet with the new session based auth flow. I suppose if they send me a user my system cannot recognize, I could run through the user oauth flow for their token and name details. Seems like a huge missed opportunity here - to make things even more messy, the Point of Sale system lets you get the `pos.user` which has name, email, account owner flag, etc - but no way to get that same level of information outside of point of sale.
Being on the other side of this ecosystem - I am so confused as to how it's this screwy.
+1 on this.
+1 From me.
We need the current user feature to identify the user and perform specific tasks provided to him by the store owner. Basically for the multiuser functionality.
User | RANK |
---|---|
10 | |
4 | |
3 | |
3 | |
3 |
We're excited to announce improvements to the threaded messaging experience in our communi...
By TyW May 31, 2023Thank you to everyone who participated in our AMA with Klaviyo. It was great to see so man...
By Jacqui May 30, 2023Photo by Marco Verch Sales channels on Shopify are various platforms where you can sell...
By Ollie May 25, 2023