> ## Documentation Index
> Fetch the complete documentation index at: https://dev.smile.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Lifecycle events

The SDK dispatches lifecycle events at key moments during its setup and operation. The flow of events follows this sequence:

1. **Script loads** → [`smile-js-loaded`](/js/concepts/loaded-event) 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()`](/js/smile/initialize).

2. **Initialization** → [`Smile.initialize()`](/js/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).

3. **Initialization complete** → [`smile-js-initialized`](/js/concepts/initialized-event) event fires.
   * SDK is fully ready to use.

   * All methods can be called safely.

   * Preloaded data is available.
