@amplifyup/sdk 0.1.34 → 0.1.35

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -86,8 +86,36 @@ Field names must match the component registry in AmplifyUp. Connect CMS document
86
86
  | Production visitors | Edge `/v1/resolve` | Default |
87
87
  | Next.js SSG / ISR | Edge `/v1/routes` then `/v1/resolve` | `generateAmplifyStaticParams` + `fetchPageConfigServer` |
88
88
  | Composer preview | Orchestrator layout provider | `?preview=true` / Composer iframe |
89
+ | Runtime queries | Edge `/v1/query` | `queryContent` — search, load more, pickers |
89
90
 
90
- The SDK maps Edge’s resolved tree into `layoutTree` and renders it. Edge already applies personalization and CMS projection — the site does not call CMS or Decision APIs for layout. Visitor-specific variants overlay the static HTML in the browser by default (`clientPersonalization`).
91
+ The SDK maps Edge’s resolved tree into `layoutTree` and renders it. Edge already applies personalization and CMS projection — the site does not call CMS or Decision APIs for layout. After paint, the overlay calls `POST /v1/select` (or `selectVariants()`) then `/v1/resolve?variants=` so decisions stay on the edge (`clientPersonalization`).
92
+
93
+ ## Runtime queries
94
+
95
+ Page resolve covers data known at Deploy. For data a visitor asks for — search, load more, a picker — use `queryContent`. The browser asks AmplifyUp, AmplifyUp asks your content source, so no CMS credentials or query syntax live in your site.
96
+
97
+ Mark a query connection **paginated** in Composer and the list prop gains pagination meta, including the published query spec:
98
+
99
+ ```tsx
100
+ 'use client';
101
+ import { queryContent, nextPageSpec, searchSpec } from '@amplifyup/sdk/react';
102
+
103
+ // next page
104
+ const more = await queryContent({
105
+ trackingId,
106
+ route: '/insights',
107
+ spec: nextPageSpec(postsPagination),
108
+ });
109
+
110
+ // search — keep `?q=` as input only; do not read searchParams on the server page
111
+ const hits = await queryContent({
112
+ trackingId,
113
+ route: '/insights',
114
+ spec: searchSpec(postsPagination, 'title', term),
115
+ });
116
+ ```
117
+
118
+ Only entities published with that route can be queried, and visitors only see published content. Also available from `@amplifyup/sdk/server`. See the [runtime queries guide](../../docs/sdk-site-setup.md#8-runtime-content-queries).
91
119
 
92
120
  ## Track events
93
121