> ## 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.

# Loaded event

> `smile-js-loaded`

This event is dispatched when the SDK script finishes loading and the `Smile` object becomes available in the global scope. In general, you can expect this event to be dispatched before the `smile-js-initialized` event.

## When to use

Listen for this event when loading the SDK asynchronously to ensure the SDK is ready before calling [`Smile.initialize()`](/js/smile/initialize). This is particularly useful when the SDK script tag has the `async` attribute.

## Good to know

* This event is dispatched automatically when the SDK module loads.
* It fires only once per page load.
* If you're loading the script synchronously, you don't need to listen for this event.
* The event is dispatched before any SDK methods are called.

<Panel>
  ```javascript JavaScript lines theme={null}
  document.addEventListener(
    'smile-js-loaded', () => {
      // SDK is loaded and is ready to initialize
    }
  );
  ```
</Panel>
