Skip to content

Clarify CDN initialization for InlineJS v2 - #129

Merged
Andrew-Paystack merged 2 commits into
PaystackOSS:mainfrom
gloriadasilva:docs/fix-cdn-initialization
Jul 21, 2026
Merged

Clarify CDN initialization for InlineJS v2#129
Andrew-Paystack merged 2 commits into
PaystackOSS:mainfrom
gloriadasilva:docs/fix-cdn-initialization

Conversation

@gloriadasilva

Copy link
Copy Markdown
Contributor

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 PaystackPop globally rather than Paystack.

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.

@Andrew-Paystack

Copy link
Copy Markdown
Member

Hey @gloriadasilva ,

Thanks for this submission. We're reviewing this and we'll share an update soon

@Andrew-Paystack

Copy link
Copy Markdown
Member

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.
Would you be able to split them into separate files, one per install method‚ similar to how we've done it in Installation?

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.

@gloriadasilva

Copy link
Copy Markdown
Contributor Author

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.

@Andrew-Paystack
Andrew-Paystack merged commit 8da5288 into PaystackOSS:main Jul 21, 2026
@Andrew-Paystack

Copy link
Copy Markdown
Member

Thanks so much @gloriadasilva! 🚀

Changes should be live in a few.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants