Clarify CDN initialization for InlineJS v2 - #129
Conversation
|
Hey @gloriadasilva , Thanks for this submission. We're reviewing this and we'll share an update soon |
|
Hi @gloriadasilva, Thanks for digging into this and catching it! One ask before we merge: right now the CDN and NPM/Yarn examples are combined into a single snippet. On our end we'll wire those up as code tabs on the docs so readers only see what's relevant to their setup. No worries if you're short on time‚ happy to make that split ourselves in a follow-up commit and credit your fix either way. Just wanted to check with you first since you're already in the file. |
|
Hi, @Andrew-Paystack . I've split the snippet into separate cdn.js and npm.js files under initialize/, following the same pattern as installation/. You can review whenever you have a chance. |
|
Thanks so much @gloriadasilva! 🚀 Changes should be live in a few. |
Hi, @Andrew-Paystack
I tried initiating a new transaction using the CDN build and followed the documentation example:
const popup = new Paystack();
However, this resulted in: "Uncaught ReferenceError: Paystack is not defined"
After investigating, I inspected the downloaded v2/inline.js file in the Network tab and noticed that the CDN build exposes
PaystackPopglobally rather thanPaystack.The following works correctly:
const popup = new PaystackPop();
This PR updates the documentation to clarify the correct initialization method for CDN users and helps prevent other developers from encountering the same issue.