Skip to main content
The collections module organizes the logged-in user’s saved content. Every user has a single root collection, under which they can nest sub-collections and into which they can save entities.

fetchRootCollection

Fetches the logged-in user’s root collection.
ReturnsPromise<Collection>

fetchSubCollections

Fetches the immediate sub-collections of a collection.
string
required
The parent collection ID.
ReturnsPromise<Collection[]>

createNewCollection

Creates a sub-collection under a parent collection.
string
required
The parent collection under which to create the sub-collection.
string
required
The name of the new collection.
ReturnsPromise<Collection>

fetchCollectionEntities

Fetches the entities within a collection, paginated.
string
required
The collection ID.
number
The page number to fetch.
number
The number of entities to return per page.
"new" | "added" | "top" | "hot"
Sort order.
"asc" | "desc"
Sort direction.
string
Comma-separated related resources to include in the response.
ReturnsPromise<PaginatedResponse<Entity>>

addEntityToCollection

Adds an entity to a collection.
string
required
The collection ID.
string
required
The ID of the entity to add.
ReturnsPromise<{ success: boolean; collection: { id: string; entityCount: number } }>

removeEntityFromCollection

Removes an entity from a collection.
string
required
The collection ID.
string
required
The ID of the entity to remove.
ReturnsPromise<{ success: boolean; collection: { id: string; entityCount: number } }>

updateCollection

Renames a collection.
string
required
The collection ID.
string
The new collection name.
ReturnsPromise<Collection>

deleteCollection

Deletes a collection.
string
required
The collection ID.
ReturnsPromise<void>