Skip to main content
openbridge.collections.get(idOrHandle)
openbridge.collections.get(idOrHandle).select(fields)
Fetches a single collection by handle or Shopify GID. Supports chaining .select() to limit fields.

Parameters

ParamTypeRequiredDescription
idOrHandlestringYesCollection handle or Shopify GID

Returns

ShopifyCollection | null

Examples

Get by handle

const collection = await openbridge.collections.get('summer-sale')

if (collection) {
    console.log(collection.title)
}

Get by Shopify GID

const collection = await openbridge.collections.get(
    'gid://shopify/Collection/123456789'
)

With field selection

const collection = await openbridge.collections
    .get('new-arrivals')
    .select(['title', 'handle', 'image', 'seo'])

Handle not found

const collection = await openbridge.collections.get('non-existent')

if (!collection) {
    console.log('Collection not found')
}