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

> `SmileUI.customerReady()`

> [!CAUTION]
>
> This method has been removed. Refer to the [migration guide](https://dev.smile.io/guides/use-cases/custom-frontend/js-sdk-migration.md#3-update-customer-ready-calls) for instructions on choosing the appropriate replacement.

This method is used to detect when customer identification has completed and is useful for wrapping any code (or other Smile UI 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](https://dev.smile.io/ui/objects/customer.md) object when there is a currently logged-in customer, or `null` if no customer is currently logged-in.
* On failure, an error object.

```javascript JavaScript lines theme={null}
SmileUI.customerReady().then(customer => {
  if (customer) {
    // A customer is logged in
  } else {
    // No customer was identified (user needs
    // to log in or create an account)
  }
}).catch(err => {
  // An error has occurred will trying to
  // identify a customer
});
```
