Question:
How do I check the Web SDK initialization parameters when the page code is minified?
Answer:
If you need to debug the website but cannot locate the initialization code (like the one in step 4.3 of the guide), you can read it back from the browser instead. The steps below are for Chrome.
First, open the Application tab of DevTools:
Then go to IndexedDB -> PUSHWOOSH_SDK_STORE -> keyValue:
Here you can check the initialization parameters, the SDK and service worker versions, and more.
The SDK must be initialized for these values to appear. For example, if the SDK works in Chrome but not in Safari, you can use Chrome's IndexedDB store to double-check that safariWebsitePushID was entered correctly.
If a value you added is still missing from the stored init params, and the SDK is loaded via npm rather than the CDN script tag, you can also search the minified bundle for it: open view-source:https://yoursite.com, find the <script> tags, open the referenced JS files, and search for Pushwoosh. You should find something like:
PUSHWOOSH:{APPLICATION_CODE:"XXXXX-XXXXX",AUTO_SUBSCRIBE:!0,LOG_LEVEL:E.NONE,USER_ID:null}
Comments
0 comments
Please sign in to leave a comment.