Quick Context
Shopify requires Theme App Extensions for theme modifications instead of ScriptTags. Our app dynamically shows badges like “Sale”, “New” on products based on real-time API data (tags, inventory, price ranges, etc.).
The Problem
Our badges need:
- Real-time API calls for badge configs
- Dynamic rendering based on product data
- Complex conditional logic per merchant
Sample API response:
{
"badges": [{
"text": "Sale",
"includedTags": ["sale"],
"inventoryMax": 10,
"backgroundColor": "linear-gradient(45deg, #ff5f6d, #9944dc)"
}]
}
Main Questions
- Can Theme App Extensions handle dynamic, API-driven badge injection across multiple products?
- What’s the recommended approach for real-time conditional rendering without ScriptTags?
- Are there limitations with Theme App Extensions for this use case?
What We’ve Tried
Created Theme App Extension
Can’t implement dynamic API logic in Liquid templates
App blocks don’t seem to support real-time data fetching
Looking For
- Working examples of similar dynamic content
- Confirmation if this is even possible with current Theme App Extensions
- Alternative Shopify-compliant approaches
Has anyone built dynamic product badges with Theme App Extensions? Any guidance would be appreciated!