Repository navigation
feat: Add Ecosystem components (CompatibleApps, SupportedDevices) - #745
Merged
Merged
Conversation
Add Seam Ecosystem (PartnerDB and DeviceDB) components for marketing and product pages: - CompatibleApps / <seam-compatible-apps>: the live partner apps that support a device type, manufacturer, provider or capability, from GET /v1/compatibility (declared-first), with per-partner notes. - SupportedDevices / <seam-supported-devices>: device models grouped by manufacturer with device type and capability badges, search and filters, from GET /v1/device_models/list. Defaults to the manufacturer of a manufacturer embed key and hides a partner key's declared exclusions (GET /v1/embed/resolve). Add EcosystemProvider, an embedKey and ecosystemEndpoint prop on SeamProvider, react-query hooks that send X-Embed-Key, and Ecosystem response types copied from seamapi/ecosystem public-types. Add a lightweight dist/ecosystem.js bundle (@seamapi/react/ecosystem.js) with only the Ecosystem elements and no Seam API client; elements.js also defines them. CI checks its size. Storybook and tests use a fake Ecosystem API (.storybook/fake-ecosystem.js, served at /api/ecosystem), never a real embed key or production data. Fixes DEVDB-443 Fixes DEVDB-444 Fixes DEVDB-445 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds Seam Ecosystem (PartnerDB and DeviceDB) components to Seam Components, plus a lightweight
ecosystem.jsbundle for marketing and product pages.Fixes DEVDB-443
Fixes DEVDB-444
Fixes DEVDB-445
What's new
CompatibleApps/<seam-compatible-apps>(DEVDB-444), ported from custom-device-db-web#43 and rebuilt in the repo's SCSS (seam-classes, global CSS injection) with light, dark and auto themes.GET /v1/compatibility(declared-first). Shows each partner's support note whenproviderorcapabilityis set.device-type(required),manufacturer,provider,capability,industry,max-visible,hide-search,hide-title,theme.SupportedDevices/<seam-supported-devices>(DEVDB-445) brings back a DeviceDB component, now backed by EcosystemGET /v1/device_models/list(all pages) andmanufacturers/listfor logos.manufacturer,device-type,capability,hide-search,hide-filters,hide-title,theme.embed/resolve. It reads the optionalmanufacturer_context.manufacturer_slug(DEVDB-439, not shipped yet) and falls back toembed_key.manufacturer_slugwhenowner_kindismanufacturer, which Ecosystem already returns. An explicitmanufacturerattribute wins.embed/resolve, like<device-list-by-capability>(DEVDB-371). That covers excluded manufacturers and device types, unsupported providers, and capability exclusions for thecapabilitybeing shown.Foundation (DEVDB-443)
EcosystemProvider(no publishable key, no Seam API client).SeamProvideralso getsembedKeyandecosystemEndpointprops (defaulthttps://ecosystem.seam.co/v1/), so React apps can drop the components in.useCompatiblePartners,useEcosystemDeviceModels,useEcosystemManufacturers,useEmbedKeyResolution. They sendX-Embed-Keyand don't retry 4xx errors.seamapi/ecosystempublic-types(origin/main 733edf3) insrc/lib/seam/ecosystem/types.ts, so there's no zod dependency.src/ecosystem.ts→dist/ecosystem.js, exported as@seamapi/react/ecosystem.js. It's built separately, so both bundles stay self-contained, and it's fully minified.elements.jsalso registers both elements. Elements that are already defined are skipped, so a page can load both bundles.<seam-compatible-apps hide-search>), which r2wc would otherwise parse as false.npm run sizeruns in_build.ymlafter the build. It fails ifecosystem.jsgoes over 80 kB gzip or bundles the Seam API client.Note:
SeamProvider(viaSeamQueryProvider) throws without a publishable key or client session token, so the Ecosystem elements use their own lightweightEcosystemProviderwrapper instead of sharing theSeamProviderwrapper.Bundle size
dist/ecosystem.js(new)dist/elements.js(before)dist/elements.js(after, includes the Ecosystem elements)ecosystem.jsis React + react-dom + TanStack Query + r2wc + the two components. The CSS is still the sharedindex.min.css(65.5 kB raw / 8.9 kB gzip), injected from react.seam.co.Usage
Plain HTML:
React:
The README documents attributes, hooks and CSP (
connect-src https://ecosystem.seam.co; img-src https://seam-ecosystem-media.fly.storage.tigris.dev).Storybook and tests: no real key or production data
.storybook/fake-ecosystem.jsis a fake of the public Ecosystem API. It has fictional partners, sample device models and generated SVG images. It ports Ecosystem's declared-firstresolveSupportandexclusionsFromSupportRows, its error shapes (embed_key_required,invalid_embed_key,origin_not_allowed,invalid_params) and its pagination./api/ecosystem: locally by the Storybook middleware, and on react.seam.co byapi/fake-ecosystem.tsthrough avercel.jsonrewrite placed before the/api/*rewrite. Requests stay same-origin, so the existing CSP is unchanged.setupFakeEcosystem()intest/fixtures/ecosystem.tsx):SeamProvider.<seam-compatible-apps>from attributes.Screenshots
Rendered headlessly against the fake API, from the local Storybook and from this PR's Vercel preview (no console or CSP errors). Live on the preview:
CompatibleApps and SupportedDevices. Screenshots are attached to DEVDB-444 and DEVDB-445.
Checks run locally
npm run lint,npm run typecheck,npm test(64 tests),npm run build,npm run sizeandnpm run docs:buildall pass.Follow-ups (not in this PR)
device_models/listresponses are large and uncompressed: about 70 kB per model, mostlyvariants[].marketplace_listings. Caddy sends nocontent-encoding, so a 500-model page is about 11.7 MB. A manufacturer's list will be slow on a product page until Ecosystem compresses responses or offers a slimmer list view, e.g., the manufacturer content API (DEVDB-437).🤖 Generated with Claude Code