getCollections
const collections = await client.getCollections()
Returns the list of collections for the project ordered by creation date. Does not include photos — use getCollection(id) to get those.
Parameters
None.
Returns
interface GalleryCollection {
id: string // UUID
name: string // e.g. "Ceremony"
createdAt: string // ISO-8601
}
Example
const collections = await client.getCollections()
for (const col of collections) {
renderNavItem({ href: `/collections/${col.id}`, label: col.name })
}
getCollection
const collection = await client.getCollection(id)
Returns a single collection with all its approved photos, sorted by position within the collection.
Parameters
UUID of the collection. Obtain it from getCollections().
Returns
interface GalleryCollectionDetail extends GalleryCollection {
photos: GalleryPhoto[] // Same shape as getPhotos()
}
Example
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`)
}
Errors
| Status | Code | Cause |
|---|
| 401 | UNAUTHORIZED | Token invalid |
| 404 | NOT_FOUND | Collection not found (getCollection only) |
| 500 | INTERNAL_ERROR | Server error |