Get the UUID of theme app extension hosted

We are writing an E2E test that checks if the theme app extension’s codebase works properly after a shopify app deploy.

How can we get the UUID portion of the URL where the theme app extension is stored.

For e.g. When our extension loads on the merchant site the bundle.js is fetched from locaiton
https://cdn.shopify.com/extensions/c7477707-4967-4f1b-b14f-c43437ae7fe4/<APP_NAME-118>/assets/bundle.js

We’d like to get the value c7477707-4967-4f1b-b14f-c43437ae7fe4

We tried using shopify app info --json but the UUID shown there is not the same.

Hey @Yash_Ranadive :waving_hand: can you share why you need the UUID? For most cases (like deep linking), the uuid parameter is deprecated and you should use api_key instead (api_key is the same as client_id in your app.toml).

Docs here with a bit more info: Configure theme app extensions

If you specifically need the UUID that appears in the CDN path for testing, you should still be able to retrieve it from your project’s .env after you run shopify app deploy at least once. Look for SHOPIFY_<EXTENSION_NAME>_ID, I believe that should correspond to the theme app extension’ UUID in the CDN.

Could you let me know if the above doesn’t work for you and is still showing the incorrect UUID? Just want to understand your use case a little more so I can provide better guidance on my end here - hope to hear from you soon!

Hey @Yash_Ranadive :waving_hand: can you share why you need the UUID?

We want to accidentally prevent bad code to be shipped to the shopify extension. We have tests on our end to prevent that before shipping, but sometimes, due to rush during hotfixes, etc. things can get missed and bad code can get shipped. A way to detect this is to get the bundle.js updated location from shopify after the code is shipped using shopify app deploy.

you should still be able to retrieve it from your project’s .env after you run shopify app deploy at least once

Our .env.prod contains SHOPIFY_<EXTENSION_NAME>_ID and I can confirm that it does not match the CDN URL where the bundle is hosted. We’ve noticed the bundle URL changes over time (possibly after every deploy) .

LMK if that doesn’t sound right to you @Alan_G

Hey @Yash_Ranadive thanks for following up and for the context, that use case definitely makes sense.

The mismatch you’re seeing between the .env value and the CDN URL does sound odd. I think for my next steps here, I’m going to check with our product team on this to confirm the expected mapping and the best way to programmatically retrieve the bundle URL after deploy.

Could you can share the exact bundle.js CDN URL you’re seeing and the SHOPIFY_<EXTENSION_NAME>_ID from your root .env after your last deploy? If you’d prefer to keep that private, I can set up a DM here in the forums, just ping me here and let me know :slight_smile:

Yes please set a DM so I can share both those with you.

Sending you a DM now @Yash_Ranadive - speak soon there!

Looking foward to your DM @Alan_G I haven’t received it yet.

Hey @Yash_Ranadive :waving_hand: , thanks for flagging me on this. Very odd, it does look like I sent one out two days ago here on the forums from what I can see on my end.

I’ll set up a new one, let me know if you don’t receive that one and I’ll look into this :slight_smile: