Answerly Docs logo
Found 0 Answers

Waiting for the FacePop SDK to initialize

author picture

Fatos Bediu

Founder & Developer

It might take a few milliseconds for the FacePop to load on your website and initialize the SDK fully. 

Since this is the case, accessing the SDK directly on your website will throw errors since your code might run before the SDK has been initialized. 

Fortunately, FacePop emits an event FacePop:Loaded to the main window, which you should listen to and only use the SDK after that event has been fired. 

For example:

window.addEventListener('FacePop:Loaded', () => {
    // SDK is available here

    // example code;


Did we answer your question?

😃 🤔 ☹️

How can we improve this answer?