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

# Customer ready

> `Smile.customerReady()`

<Danger>
  This method is deprecated and will be removed on August 1, 2026. Specify `includeSdk: true` when [initializing Smile UI](/ui/initializing), and then listen for the [`smile-js-initialized`](/js/concepts/initialized-event) event from the JavaScript SDK instead.
</Danger>

This method is used to detect when customer identification has completed and is useful for wrapping any code (or other `Smile` methods) that require a logged-in customer. It can also be used to decide when to render a logged-in vs. logged-out state.

## Returns

This method returns a `Promise` that resolves once customer identification has occurred (even if there is no logged-in customer) and does not wait for other dependencies. If customer identification has already occurred, the `Promise` will resolve immediately.

The `Promise` will resolve with:

* On success, a [customer](/ui/objects/customer) object when there is a currently logged-in customer, or `null` if no customer is currently logged-in.
* On failure, an error object.

<Panel>
  ```javascript JavaScript lines theme={null}
  Smile.customerReady().then((customer) => {
    if (customer) {
      // A customer was identified,
      // render a logged in state
    } else {
      // A customer was not identified,
      // render a logged out state
    }
  }).catch(err => {
    // An error occurred while
    // identifying the customer
  });
  ```
</Panel>
