Skip to main content
The SDK dispatches lifecycle events at key moments during its setup and operation. The flow of events follows this sequence:
  1. Script loadssmile-js-loaded event fires.
    • The Smile object becomes available in the global scope.
    • SDK methods exist but are not yet ready to use.
    • It is now possible to call Smile.initialize().
  2. InitializationSmile.initialize() is called.
    • The SDK authenticates with the Smile API.
    • Any preloaded resources are fetched and cached.
    • A customer session is established (if customer token provided).
  3. Initialization completesmile-js-initialized event fires.
    • SDK is fully ready to use.
    • All methods can be called safely.
    • Preloaded data is available.