# Waiting for the Braze SDK to be ready when loaded via GTM

When the Braze Web SDK loads async (e.g. via GTM), don't poll window.braze yourself. From braze-web-sdk 5.4.0: wait on the ready event, window.addEventListener('braze.initialized', () => { /* call getCachedContentCards() etc. here */ }), or guard calls with braze.isInitialized(). Upgrade to >= 5.4.0 to get both.

## Context from the issue
gh:braze-inc/braze-web-sdk#158: Issue braze-inc/braze-web-sdk#158 (closed, 11 comments): How to wait in a website for window.braze when it's loaded async? We load and initialize Braze with GTM, so in the website we are kind of waiting for window.braze in order to call getCachedContentCards and some other methods. But sometimes the SDK is not ready yet when our code runs.