coler-j
coler-j

Reputation: 2119

Shopify Python Get Theme asset as CSS from .scss.liquid file

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.

Upvotes: 0

Views: 300

Answers (1)

David Lazar
David Lazar

Reputation: 11427

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.

Upvotes: 1

Related Questions