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

# .isLoggedIn()

> Check if a customer is currently logged in

```javascript theme={null}
openbridge.customer.isLoggedIn()
```

Synchronously checks whether a valid (non-expired) customer access token is stored locally. Does not make a network request.

## Returns

`boolean` — `true` if a non-expired access token is present, `false` otherwise.

## Examples

### Conditional UI rendering

```javascript theme={null}
if (openbridge.customer.isLoggedIn()) {
    showAccountMenu()
} else {
    showLoginButton()
}
```

### Protecting an action

```javascript theme={null}
document.querySelector('#checkout-btn').addEventListener('click', () => {
    if (!openbridge.customer.isLoggedIn()) {
        openLoginModal()
        return
    }

    openbridge.cart.checkout()
})
```

<Info>
  This check is purely local — it only verifies a token exists and has not expired. To validate the session against Shopify, call [`customer.get()`](/api/customer/get).
</Info>


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.