Detect Admin/Shop Owner Logged into Store

Topic summary

Developers are seeking methods to detect when a shop owner or admin user is logged into a Shopify store to enable special “admin mode” features in their apps.

API Approach Limitations:

  • The User resource in Shopify’s REST Admin API can identify store owners via an attribute
  • However, this resource is only available for private apps and custom apps on Shopify Plus stores
  • Not accessible for public apps, which seems restrictive given their prevalence

Liquid-Based Solution:
A workaround uses content_for_header in Liquid templates to detect admin/staff users and theme designers:

  • Captures the content_for_header value and checks for ‘adminBar’ or ‘designMode’ strings
  • These strings only appear when an admin/staff member is logged in or theme designer is active
  • Allows conditional loading of scripts (e.g., app proxy scripts) based on user type
  • If the code is present, result is empty string; if absent (normal visitor), the code executes

This Liquid method provides a practical alternative for apps that cannot access the User API resource.

Summarized with AI on November 20. AI used: claude-sonnet-4-5-20250929.

I’m also looking for guidance on this as well.

There is a User resource in the API, which has an attribute that indicates if the User is the store owner. However, the documentation says:

The User resource is available forprivate appsandcustom appsinstalled on**Shopify Plus**stores. Contact Shopify Plus Support to enable this API resource for your store.

https://shopify.dev/api/admin-rest/2022-01/resources/user#top

I’m not sure if that means it’s ONLY available for those apps, which seems strange given priority of Public apps.

That said, I’m also trying to adjust our UX if the user is store admin, so any guidance from Shopify would be helpful.