Skip to main content

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.

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

Returns

booleantrue if a non-expired access token is present, false otherwise.

Examples

Conditional UI rendering

if (openbridge.customer.isLoggedIn()) {
    showAccountMenu()
} else {
    showLoginButton()
}

Protecting an action

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

    openbridge.cart.checkout()
})
This check is purely local — it only verifies a token exists and has not expired. To validate the session against Shopify, call customer.get().