What Are Collections?
Collections are a personal bookmarking system built into Sublay. Each authenticated user has a private library of named folders — called collections — where they can save entities for later reference.Requires the
collections bundle. Collections are only available when the collections bundle is installed on your project. See Bundles to add it.Collections are private. They belong to and are only visible to the user who created them.
How It Works
- Root collection — automatically created the first time a user accesses their collections. Acts as the top-level folder and cannot be renamed or deleted.
- Sub-collections — folders created inside the root or inside other sub-collections. Can be renamed and deleted.
- Entities — saved into the current collection. The same entity can appear in multiple collections.
Hooks
useCollections
Navigate the collection hierarchy and perform CRUD operations on the current collection context.
useCollectionsActions
Lower-level actions for fetching, creating, updating, and deleting collections.
useCollectionEntitiesWrapper
Fetch paginated entities saved in a specific collection with sort and load-more support.
To check whether a specific entity is saved in any of the user’s collections, see useIsEntitySaved in the entities section.

