// Initialize
openbridge.init({
token: 'your-storefront-token',
storeDomain: 'store.myshopify.com'
})
// Collections
const collections = await openbridge.collections.list()
const collection = await openbridge.collections.get('summer-sale')
// Products
const products = await openbridge.products.list()
const product = await openbridge.products.get('blue-shirt')
// Products by collection
const { items } = await openbridge.products.collection('sale').list()
// With options
const result = await openbridge.products
.collection('new')
.limit(6)
.select(['title', 'handle', 'priceRange'])
.list()
// Cart
await openbridge.cart.init()
await openbridge.cart.add('gid://shopify/ProductVariant/123', 2)
openbridge.cart.checkout()
// Customer Authentication
const customer = await openbridge.customer.login('[email protected]', 'password')
const { orders } = await openbridge.customer.orders()
await openbridge.customer.logout()