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.Promise<Collection>
fetchSubCollections
Fetches the immediate sub-collections of a collection.The parent collection ID.
Promise<Collection[]>
createNewCollection
Creates a sub-collection under a parent collection.The parent collection under which to create the sub-collection.
The name of the new collection.
Promise<Collection>
fetchCollectionEntities
Fetches the entities within a collection, paginated.The collection ID.
The page number to fetch.
The number of entities to return per page.
Sort order.
Sort direction.
Comma-separated related resources to include in the response.
Promise<PaginatedResponse<Entity>>
addEntityToCollection
Adds an entity to a collection.The collection ID.
The ID of the entity to add.
Promise<{ success: boolean; collection: { id: string; entityCount: number } }>
removeEntityFromCollection
Removes an entity from a collection.The collection ID.
The ID of the entity to remove.
Promise<{ success: boolean; collection: { id: string; entityCount: number } }>
updateCollection
Renames a collection.The collection ID.
The new collection name.
Promise<Collection>
deleteCollection
Deletes a collection.The collection ID.
Promise<void>
