Skip to main content
JavaScript
Smile.ready()
  .then((smileInstance) => {
    // Smile has been fully intialized and is ready to be used.
    // Note that 'Smile' and 'smileInstance' refer to the same object.
  })
  .catch((err) => {
    // An error has occurred while initializing Smile.
  });
This method is used to detect when Smile.js and it’s dependencies have been fully initialized and are ready to be interacted with. It is useful for wrapping calls to other methods on the Smile object.
If your code will make use of the functionality provided by the Smile UI object, use the SmileUI.ready() method instead.

Returns

This method returns a Promise that resolves once Smile.js and it’s dependencies have been fully initialized. If initialization has already occurred, the Promise will resolve immediately. The Promise will resolve with:
  • On success, an initialized instance of the Smile object.
  • On failure, an error object.