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.getCached()
Returns the customer object currently held in memory without making a network request. Populated by customer.init(), login(), register(), get(), and update().

Returns

ShopifyCustomer | null — the cached customer, or null if no customer is logged in. See ShopifyCustomer for the full shape.

Examples

Synchronous access for SSR-style rendering

const customer = openbridge.customer.getCached()

if (customer) {
    document.querySelector('#greeting').textContent = `Hello, ${customer.firstName}`
}

Avoiding a redundant network call

function getCustomerEmail() {
    return openbridge.customer.getCached()?.email ?? null
}
The cache is populated when the SDK initializes a logged-in session. For the freshest data from Shopify, use customer.get() instead.