How do I access the product_form_id from app-embed.liquid?

Topic summary

A developer is migrating to Shopify Theme App Extensions and encountering an access issue with product_form_id in their app-embed.liquid file.

The Problem:

  • When attempting to include the product_form_id value from the form object in app-embed.liquid, deployment fails with an error
  • The app-embed file cannot access this variable

Previous Approach:

  • When using the Asset API, they added this as a custom liquid file that rendered alongside the main liquid file (e.g., main-product.liquid)
  • This previous method worked successfully

Current Status:

  • The developer has included a screenshot showing the error but is seeking guidance on how to properly retrieve product_form_id from within the app-embed context
  • No solution has been provided yet in the thread
Summarized with AI on November 16. AI used: claude-sonnet-4-5-20250929.

Hi, everyone.

We’ve recently updated to use Theme App Extensions.

I’m trying to include the form object with the value of product_form_id in my app-embed.liquid file. However, when I try to deploy it, I’m getting the error below. It doesn’t have access to the product_form_id.

When we’re still using the Asset API, we added this as a custom liquid file that gets rendered together with the main liquid file. (Example: main-product.liquid).

How do I retrieve it from app-embed.liquid?