Ad

Shopify Python Get Theme Asset As CSS From .scss.liquid File

- 1 answer

Is it possible to externally (from my non-embedded Shopify app) perform an API call that will emulate the functionality of the asset_url liquid tag and compile / process a .scss.liquid file into .css so that I can use it in an external app?

My app lives at subdomain.myapp.com and I want to be able to include the stores css files so that I can apply typography settings etc. from the store.

Presently I am getting the theme asset like so:

current_theme = shopify.Theme.find_first(role="main")
theme_css = shopify.Asset.find(key='assets/theme.scss.liquid', 
    theme_id=current_theme.id)

I know I could use an app proxy to embedd this page into Shopify, but I want to access the css outside of shopify.

Ad

Answer

You seem to have answered your own question with your question. Since you can make API calls to get theme assets like stylesheets, you are then free to use them as you wish. There is no difference in authentication and authorization with embedded vs. non-embedded Apps.

Ad
source: stackoverflow.com
Ad