@seamapi/react 5.3.2 → 5.4.1
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 +66 -3
- package/dist/ecosystem.js +14 -14
- package/dist/ecosystem.js.map +1 -1
- package/dist/elements.js +21042 -19731
- package/dist/elements.js.map +1 -1
- package/ecosystem-react.d.ts +3 -0
- package/ecosystem-react.js +7 -0
- package/ecosystem-react.js.map +1 -0
- package/lib/seam/components/SupportedDevices/SupportedDevices.js +2 -4
- package/lib/seam/components/SupportedDevices/SupportedDevices.js.map +1 -1
- package/lib/seam/components/SupportedDevices/presentation.d.ts +1 -0
- package/lib/seam/components/SupportedDevices/presentation.js +3 -0
- package/lib/seam/components/SupportedDevices/presentation.js.map +1 -1
- package/lib/seam/ecosystem/EcosystemProvider.d.ts +4 -2
- package/lib/seam/ecosystem/EcosystemProvider.js +9 -6
- package/lib/seam/ecosystem/EcosystemProvider.js.map +1 -1
- package/lib/seam/ecosystem/client.d.ts +5 -1
- package/lib/seam/ecosystem/client.js +4 -2
- package/lib/seam/ecosystem/client.js.map +1 -1
- package/lib/seam/ecosystem/embed-resolution.d.ts +7 -0
- package/lib/seam/ecosystem/embed-resolution.js +18 -0
- package/lib/seam/ecosystem/embed-resolution.js.map +1 -0
- package/lib/seam/ecosystem/options.d.ts +6 -0
- package/lib/seam/ecosystem/options.js +13 -0
- package/lib/seam/ecosystem/options.js.map +1 -0
- package/lib/seam/ecosystem/prefetch-supported-devices.d.ts +14 -0
- package/lib/seam/ecosystem/prefetch-supported-devices.js +79 -0
- package/lib/seam/ecosystem/prefetch-supported-devices.js.map +1 -0
- package/lib/seam/ecosystem/queries.d.ts +17 -0
- package/lib/seam/ecosystem/queries.js +144 -0
- package/lib/seam/ecosystem/queries.js.map +1 -0
- package/lib/seam/ecosystem/use-ecosystem-device-model-summaries.d.ts +5 -9
- package/lib/seam/ecosystem/use-ecosystem-device-model-summaries.js +7 -59
- package/lib/seam/ecosystem/use-ecosystem-device-model-summaries.js.map +1 -1
- package/lib/seam/ecosystem/use-ecosystem-manufacturers.d.ts +3 -3
- package/lib/seam/ecosystem/use-ecosystem-manufacturers.js +7 -41
- package/lib/seam/ecosystem/use-ecosystem-manufacturers.js.map +1 -1
- package/lib/seam/ecosystem/use-ecosystem-provider-requirements.d.ts +2 -2
- package/lib/seam/ecosystem/use-ecosystem-provider-requirements.js +6 -40
- package/lib/seam/ecosystem/use-ecosystem-provider-requirements.js.map +1 -1
- package/lib/seam/ecosystem/use-embed-key-resolution.d.ts +4 -14
- package/lib/seam/ecosystem/use-embed-key-resolution.js +8 -43
- package/lib/seam/ecosystem/use-embed-key-resolution.js.map +1 -1
- package/lib/version.d.ts +1 -1
- package/lib/version.js +1 -1
- package/package.json +23 -10
- package/server.d.ts +2 -0
- package/server.js +3 -0
- package/server.js.map +1 -0
- package/src/ecosystem-react.ts +17 -0
- package/src/lib/ecosystem-element.tsx +4 -1
- package/src/lib/seam/components/SupportedDevices/SupportedDevices.tsx +2 -11
- package/src/lib/seam/components/SupportedDevices/presentation.ts +11 -0
- package/src/lib/seam/ecosystem/EcosystemProvider.tsx +17 -7
- package/src/lib/seam/ecosystem/client.ts +14 -2
- package/src/lib/seam/ecosystem/embed-resolution.ts +20 -0
- package/src/lib/seam/ecosystem/options.ts +21 -0
- package/src/lib/seam/ecosystem/prefetch-supported-devices.ts +150 -0
- package/src/lib/seam/ecosystem/queries.ts +204 -0
- package/src/lib/seam/ecosystem/use-ecosystem-device-model-summaries.ts +10 -79
- package/src/lib/seam/ecosystem/use-ecosystem-manufacturers.ts +9 -60
- package/src/lib/seam/ecosystem/use-ecosystem-provider-requirements.ts +10 -50
- package/src/lib/seam/ecosystem/use-embed-key-resolution.ts +11 -57
- package/src/lib/version.ts +1 -1
- package/src/server.ts +5 -0
package/README.md
CHANGED
|
@@ -86,7 +86,7 @@ export function App() {
|
|
|
86
86
|
<seam-device-table publishable-key="your_publishable_key"></seam-device-table>
|
|
87
87
|
<script
|
|
88
88
|
type="module"
|
|
89
|
-
src="https://react.seam.co/v/5.
|
|
89
|
+
src="https://react.seam.co/v/5.4.1/dist/elements.js"
|
|
90
90
|
></script>
|
|
91
91
|
</body>
|
|
92
92
|
```
|
|
@@ -173,7 +173,7 @@ Load the lightweight `ecosystem.js` bundle, which only contains these two elemen
|
|
|
173
173
|
></seam-supported-devices>
|
|
174
174
|
<script
|
|
175
175
|
type="module"
|
|
176
|
-
src="https://react.seam.co/v/5.
|
|
176
|
+
src="https://react.seam.co/v/5.4.1/dist/ecosystem.js"
|
|
177
177
|
></script>
|
|
178
178
|
</body>
|
|
179
179
|
```
|
|
@@ -233,6 +233,69 @@ The data is also available with the `useCompatiblePartners`, `useEcosystemDevice
|
|
|
233
233
|
|
|
234
234
|
[Seam Ecosystem]: https://ecosystem.seam.co/
|
|
235
235
|
|
|
236
|
+
### Pre-render supported devices in Next.js
|
|
237
|
+
|
|
238
|
+
Use the native React components from `@seamapi/react/ecosystem-react.js` and the
|
|
239
|
+
server loader from `@seamapi/react/server.js` (5.4.1 or newer). The React entry
|
|
240
|
+
declares the client boundary for App Router; Next.js can still pre-render its
|
|
241
|
+
HTML when data is supplied by the server.
|
|
242
|
+
|
|
243
|
+
```tsx
|
|
244
|
+
// app/devices/page.tsx — Server Component
|
|
245
|
+
import {
|
|
246
|
+
EcosystemProvider,
|
|
247
|
+
SupportedDevices,
|
|
248
|
+
} from '@seamapi/react/ecosystem-react.js'
|
|
249
|
+
import { prefetchSupportedDevices } from '@seamapi/react/server.js'
|
|
250
|
+
|
|
251
|
+
export default async function Page() {
|
|
252
|
+
const embedKey = process.env.NEXT_PUBLIC_ECOSYSTEM_EMBED_KEY
|
|
253
|
+
const filters = {
|
|
254
|
+
manufacturer: 'august',
|
|
255
|
+
provider: 'august-access',
|
|
256
|
+
deviceType: 'smartlock',
|
|
257
|
+
}
|
|
258
|
+
const dehydratedState = await prefetchSupportedDevices({
|
|
259
|
+
...filters,
|
|
260
|
+
embedKey,
|
|
261
|
+
origin: 'https://your-site.example',
|
|
262
|
+
})
|
|
263
|
+
|
|
264
|
+
return (
|
|
265
|
+
<EcosystemProvider
|
|
266
|
+
embedKey={embedKey}
|
|
267
|
+
dehydratedState={dehydratedState}
|
|
268
|
+
disableCssInjection
|
|
269
|
+
disableFontInjection
|
|
270
|
+
>
|
|
271
|
+
<SupportedDevices {...filters} />
|
|
272
|
+
</EcosystemProvider>
|
|
273
|
+
)
|
|
274
|
+
}
|
|
275
|
+
```
|
|
276
|
+
|
|
277
|
+
Import `@seamapi/react/index.css` in `app/layout.tsx` so the server-rendered
|
|
278
|
+
content is styled before JavaScript loads. The loader resolves the key's
|
|
279
|
+
manufacturer scope and exclusions, paginates the catalog, and fetches provider,
|
|
280
|
+
manufacturer, and linked accessory details. It uses an isolated cache per call,
|
|
281
|
+
removes excluded records before serialization, and throws on failed or
|
|
282
|
+
incomplete reads. Configure the embed key's allowed origins to include the page
|
|
283
|
+
origin; the loader forwards that origin to Ecosystem for validation. Keep the
|
|
284
|
+
loader and component's key, endpoint, and filters identical.
|
|
285
|
+
|
|
286
|
+
The resulting HTML contains device names, model numbers, capabilities,
|
|
287
|
+
requirements, and accessory links. JavaScript hydrates the existing UI for
|
|
288
|
+
search, filtering, and galleries. Device disclosures and links work without
|
|
289
|
+
JavaScript; the unscoped catalog's per-manufacturer "Show all" button still
|
|
290
|
+
requires it. Server-prefetched queries remain fresh for one minute after their
|
|
291
|
+
fetch time before becoming eligible for background refresh.
|
|
292
|
+
|
|
293
|
+
For caching, pass a `fetch` implementation that applies your Next.js
|
|
294
|
+
revalidation settings. See the [working Next.js example](./examples/nextjs-supported-devices)
|
|
295
|
+
for hourly revalidation, configuration, and verification. This renders the
|
|
296
|
+
component inline in a Next.js page; it does not change the Mintlify iframe or
|
|
297
|
+
put iframe content into its parent page's HTML.
|
|
298
|
+
|
|
236
299
|
### Hosted supported-device embed
|
|
237
300
|
|
|
238
301
|
The native React page at
|
|
@@ -357,7 +420,7 @@ or place the following in the `<head>` tag:
|
|
|
357
420
|
```html
|
|
358
421
|
<link
|
|
359
422
|
rel="stylesheet"
|
|
360
|
-
href="https://react.seam.co/v/5.
|
|
423
|
+
href="https://react.seam.co/v/5.4.1/dist/index.min.css"
|
|
361
424
|
/>
|
|
362
425
|
```
|
|
363
426
|
|