For discussing the development and usage of Checkout UI extensions, post-purchase extensions, web pixels, Customer Accounts UI extensions, and POS UI extensions
We're moving the community! Starting July 7, the current community will be read-only for approx. 2 weeks. You can browse content, but posting will be temporarily unavailable. Learn more
I created an app-data metafield in an embedded app and I want to access it in the checkout ui extension but I'm unable. I've tried using `
Hi - app-data metafields are currently not supported in checkout extensions. Only the metafields linked to the resources noted in this dev doc are supported - however we're planning on including app-data metafields in future versions.
Liam | Developer Advocate @ Shopify
- Was my reply helpful? Click Like to let me know!
- Was your question answered? Mark it as an Accepted Solution
- To learn more visit Shopify.dev or the Shopify Web Design and Development Blog
Okay makes sense.
Basically what I’m trying to do is surface some app settings in my checkout ui extension that is modified by the merchant in the embedded app version of my app. What is the ideal/best practices way to achieve this. I read somewhere that you could use the Shop object to store metafields [https://github.com/Shopify/ui-extensions/discussions/1031]. Is that a good idea? How are the metafields kept private to only my app? How do I even do this?
Thank you.
Is there any roadmap item for supporting app data/reserved metafields in checkout UI extensions (and functions while we're at it). It seems like any obvious fit, not to mention some seriously confusing language - I pulled my hair out for quite a while before realising that $app: namespaced metafields cannot be surfaced in $appmetafields 😂
This is an egregious omission. It's extremely confusing and counterintuitive that app namespaced metafields are not available in the appmetafields variable.... I spent hours trying to figure this out.
Hi @Liam !
Any news on this? Have you decided if you want to include app-data metafields in customer account API?
I believe Customer Account UI extensions can utilize app namespaced metafields already, see https://shopify.dev/docs/apps/build/customer-accounts/metafields
That is slightly different. In his case he creates a metafield definition with customer as owner with an app reserved namespace
In my case I have to fetch (and then mutate) a metafield with app as owner (when creating the metafield definition, you use the app installation id as ownerId)
I think that the only way to da that is to migrate to a shop metafield
From my understanding
You can use `useMetaFields` to access public Shop Meta.
# the below configs come from "shopify.extension.toml"
# this not work
[[extensions.metafields]]
namespace = "$app:product-discount"
key = "config"
# this work, you can remove 'xxxx' and 'yyyy' to your variables
[[extensions.metafields]]
namespace = "xxxx"
key = "yyyy"