Skip to content

Clarify CDN initialization for InlineJS v2#129

Open
gloriadasilva wants to merge 1 commit into
PaystackOSS:mainfrom
gloriadasilva:docs/fix-cdn-initialization
Open

Clarify CDN initialization for InlineJS v2#129
gloriadasilva wants to merge 1 commit into
PaystackOSS:mainfrom
gloriadasilva:docs/fix-cdn-initialization

Conversation

@gloriadasilva

Copy link
Copy Markdown

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.

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.

1 participant