Embed block with unique content per app installation

I’m working on an application with a theme extension that embeds javascript from external source. Url to this file contains a unique string per app installation.

The question is how can I achieve this?

Using ScriptTag i would be able to insert custom to the liquid template via API, but from now on it’s recommended to use embed block instead.

One of the ideas I have is to ask the show owner to fill out the settings form of the embedded app in Theme settings, but I would like to avoid it and make this process fully automated.

I think i found the solution:

  1. App embed block should display what is inside the app-owned metafield
  2. Using GraphQL i am able to create app-owned metafield with a unique value per app installation. Refer to this https://community.shopify.com/c/shopify-apis-and-sdks/new-api-permission-adding-app-metafields-issue/m-p/1581603#M79726

Hi,

Did it work for you? I’m having troubles accessing {{ app.metafields.xxx.yyy }} from extension block liquid: https://community.shopify.com/c/online-store-2-0/accessing-app-owned-metafields-from-theme-extension-block-liquid/m-p/1879073#M4951

Thanks!