Get current user details with Shopify bridge or EASDK?

ClementBR
Shopify Partner
110 2 18

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

0 Likes
SBD_
Shopify Staff
Shopify Staff
1043 141 183

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.

0 Likes
ClementBR
Shopify Partner
110 2 18

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?

airhorns
Tourist
3 0 5

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! 

icon-goto
Tourist
3 0 1

+1 on this. This is EXACTLY what I'm looking for and what I'm hoping to achieve.

leighb4rnes
Shopify Partner
17 2 5

+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.

0 Likes
airhorns
Tourist
3 0 5

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 want to get current user name to provide personalized experience in my app. Unfortunately, it doesn't look like possible now...

SPO - SEO App to research keywords & edit social link preview
0 Likes
releod
Tourist
9 0 4

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. 

OliOnline
Tourist
4 0 0

+1 on this.

0 Likes