.select() to limit fields.
Parameters
Returns
ShopifyCollection | null
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
Fetch a single collection
openbridge.collections.get(idOrHandle)
openbridge.collections.get(idOrHandle).select(fields)
.select() to limit fields.
| Param | Type | Required | Description |
|---|---|---|---|
idOrHandle | string | Yes | Collection handle or Shopify GID |
ShopifyCollection | null
const collection = await openbridge.collections.get('summer-sale')
if (collection) {
console.log(collection.title)
}
const collection = await openbridge.collections.get(
'gid://shopify/Collection/123456789'
)
const collection = await openbridge.collections
.get('new-arrivals')
.select(['title', 'handle', 'image', 'seo'])
const collection = await openbridge.collections.get('non-existent')
if (!collection) {
console.log('Collection not found')
}