which namespace for metafields created by an app

Quite new to app development.

I want to add metafields to some products, the metafield is managed by my app using the admin graphql api, and I want to be able to use the metafield in the store’s theme.

I’m wondering which namespace I should use and how to make it so only my app can modify the metafield’s value ?

thanks

https://shopify.dev/docs/apps/build/custom-data/ownership#reserved-prefixes

One format for themes, for non-reserved-prefixes, is simply theme for the namespace {resource}.theme.key.

So to namespace it {resource}.{appname-or-businessname}-theme.key

Though generally theme is a metafield definition that theme developers use for merchants to create and setup specific theme behaviors.

Beyond that namespace metafields(MFs) with the app name, or company name, or acronym/initialism.

and don’t use ambiguous stuff like “custom” because everything is custom that’s the point of a metafield.

And for goodness sakes document not just the string, but the why* in public support docs.

  • example yasa-banner.label.value is inscrutable meaninglessness if you don’t define that yasa means yet-another-shopify-app because that was the companies previous previous previous name.

There used to be an informal registrar in a partners subforum to avoid naming-conflicts but forums got changed so that’s lost to internet rot.

I don’t know if something like that exists in the partner slack channels but may be worth digging around for.

So, there is always possibility of naming conflict, but it shouldn’t happen if we do it smartly. Thanks for the quick answer!

EDIT: I just noticed the link at the beginning of the answer! The “$app” thing is very helpful!