Get current user details with Shopify bridge or EASDK?

ClementBR
Shopify Partner
139 2 40

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

Replies 10 (10)
SBD_
Shopify Staff
Shopify Staff
1098 146 229

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

ClementBR
Shopify Partner
139 2 40

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 7

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
Shopify Partner
4 0 2

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

leighb4rnes
Shopify Partner
18 2 7

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

airhorns
Tourist
3 0 7

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! 

releod
Tourist
9 0 8

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
Excursionist
11 0 2

+1 on this.

sillycube
Shopify Partner
783 17 133

I want to get current user name to provide personalized experience in my app. Unfortunately, it doesn't look like possible now...

BYOB - Build Your Own Bundles, SPO - SEO App to research keywords & edit social link preview
Skylitech
Shopify Partner
8 0 4

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