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
});
This method is deprecated. Specify includeSdk: true when initializing Smile UI, and then listen for the smile-js-initialized event from the JavaScript SDK instead.
This method is used to detect when Smile 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.

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.