Bookmark Data Source
Overview
The bookmark data source fetches the content items that the current user has bookmarked. It is inherently user-specific and auto-refreshes reactively when the user adds or removes a bookmark — no manual reload required.
When to use this
Use bookmark on any view dedicated to showing a user's saved or bookmarked content.
Basic Example
{
"type": "bookmark",
"contextKey": "bookmarks",
"batchSize": 20
}Configuration
Type-specific properties
Property | Type | Default | Description |
|---|---|---|---|
filter | StorefrontCondition | — | A condition evaluated per bookmark — only bookmarks where the condition is true are included |
groupBy.issue | boolean | — | When true, groups bookmarks by their associated issue |
For common properties (contextKey, limit, batchSize, etc.) see: TODO insert link to Data Sources Overview
filter
Unlike other data sources, filter here is a condition (not a query filter) evaluated individually for each bookmark. The bookmark and its associated issue are available as $context.bookmark and $context.bookmark.issue inside the condition.
Example — include only bookmarks from a specific publication:
{
"filter": {
"value": "$context.bookmark.issue.publicationId",
"operation": "EQUALS",
"compareValue": ":publicationId"
}
}groupBy.issue
When true, bookmarks are grouped by their associated issue. Groups are sorted by issue publication date (descending). Within each group, bookmarks are ordered by page index then sequence number.
Each group header exposes the following via $context.group:
Field | Description |
|---|---|
length | Number of bookmarks in this group |
contentType | Content type of the group's items |
issueType | Type of the associated issue |
sourceIssue | The issue object — available when the issue is known |
Behavior Notes
- Default sort: Bookmarks are always sorted by creation date descending (most recently bookmarked first). This sort is fixed and cannot be overridden via config.
- Reactive refresh: The data source automatically reloads when the user adds or removes a bookmark. No view reload or manual state update is needed.
Testing Notes / Edge Cases
- filter is not a query: All bookmarks are fetched first, then each is evaluated against the condition. This affects performance for users with many bookmarks.