getCollections
getCollection(id) to get those.
Parameters
None.Returns
Example
nav.ts
getCollection
Parameters
string
required
UUID of the collection. Obtain it from
getCollections().Returns
Example
collection-page.ts
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
List all collections, or fetch a single collection with its photos.
const collections = await client.getCollections()
getCollection(id) to get those.
interface GalleryCollection {
id: string // UUID
name: string // e.g. "Ceremony"
createdAt: string // ISO-8601
}
const collections = await client.getCollections()
for (const col of collections) {
renderNavItem({ href: `/collections/${col.id}`, label: col.name })
}
const collection = await client.getCollection(id)
getCollections().interface GalleryCollectionDetail extends GalleryCollection {
photos: GalleryPhoto[] // Same shape as getPhotos()
}
const collections = await client.getCollections()
const first = collections[0]
if (first) {
const detail = await client.getCollection(first.id)
console.log(`${detail.name}: ${detail.photos.length} photos`)
}
| Status | Code | Cause |
|---|---|---|
| 401 | UNAUTHORIZED | Token invalid |
| 404 | NOT_FOUND | Collection not found (getCollection only) |
| 500 | INTERNAL_ERROR | Server error |