Using the last CDN from app bridge returns undefined

When i load the the library https://cdn.shopify.com/shopifycloud/app-bridge.js

and i go to the console and do window[‘app-bridge’];

i keep getting undefined what should i do here?

Hey @david_coelho :wave:

The window[‘app-bridge’] variable doesn’t exist in that CDN script. You can use the shopify global to view some of available the App Bridge features.

For example, you can use await shopify.resourcePicker({ type: 'product' }); to open up the resource picker. Check out the docs here!

1 Like

I understand that but specifically what do i need to do to pass the test
Using the latest App Bridge script loaded from Shopify’s CDN

since im already using the correct cdn, do i need to get the authentication token while using this cdn ? Im using php and js no cli or npms

How are you including the script tag in your app? Are you including it as outlined in the Getting started guide?

<head>
  <meta name="shopify-api-key" content="%SHOPIFY_API_KEY%" />
  <script src="https://cdn.shopify.com/shopifycloud/app-bridge.js"></script>
</head>

It just needs to be included to pass that check. It will take a bit of time (~24 hours) to update the check.

so no matter what having that will result in passing the requirement?