Skip to main contentThe SDK dispatches lifecycle events at key moments during its setup and operation. The flow of events follows this sequence:
-
Script loads →
smile-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().
-
Initialization →
Smile.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).
-
Initialization complete →
smile-js-initialized event fires.
-
SDK is fully ready to use.
-
All methods can be called safely.
-
Preloaded data is available.