Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,13 @@ hosts such as Mintlify that cannot import an npm component. It composes
`EcosystemProvider` and `SupportedDevices`, reads the public production Ecosystem
catalog without an embed key, and never uses Storybook fixtures or Strapi.

The hosted page reads `/ecosystem/v1/device_models/summaries/list` and
`/ecosystem/v1/manufacturers/list` on its own origin. Vercel forwards these two
public routes to the production Ecosystem API, preserving query parameters.
This avoids browser local-network restrictions when a visitor's VPN or split DNS
resolves `ecosystem.seam.co` to a private address. Vite proxies the same paths
during local development. These routes do not expose admin or write endpoints.

Query parameters are `manufacturer`, `provider` (Ecosystem slugs, not Seam Connect
provider keys), `device_type`, `capability`, and `theme` (`light`, `dark`, `auto`).
For example, use `?manufacturer=dormakaba&provider=oracode` to avoid listing other
Expand Down
6 changes: 5 additions & 1 deletion examples/supported-devices/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,11 @@ export function App(): JSX.Element {
: `https://www.seam.co/manufacturers/${encodeURIComponent(config.manufacturer)}`

return (
<EcosystemProvider disableCssInjection disableFontInjection>
<EcosystemProvider
ecosystemEndpoint='/ecosystem/v1/'
disableCssInjection
disableFontInjection
>
<SupportedDevices {...config} theme={theme} />
<p className='seam-device-embed-footer'>
<a href={catalogUrl} target='_blank' rel='noopener noreferrer'>
Expand Down
5 changes: 5 additions & 0 deletions examples/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,11 @@ export default defineConfig(async ({ command, mode }) => {
server: {
port: 8080,
proxy: {
'/ecosystem/v1': {
target: 'https://ecosystem.seam.co',
rewrite: (path: string) => path.replace(/^\/ecosystem/, ''),
changeOrigin: true,
},
'/api': {
target,
rewrite: (path: string) => path.replace(/^\/api/, ''),
Expand Down
10 changes: 9 additions & 1 deletion vercel.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,14 @@
},
"cleanUrls": true,
"rewrites": [
{
"source": "/ecosystem/v1/device_models/summaries/list",
"destination": "https://ecosystem.seam.co/v1/device_models/summaries/list"
},
{
"source": "/ecosystem/v1/manufacturers/list",
"destination": "https://ecosystem.seam.co/v1/manufacturers/list"
},
{
"source": "/v/:version/:asset*",
"destination": "https://react.seam.net/v/:version/:asset"
Expand Down Expand Up @@ -165,7 +173,7 @@
"headers": [
{
"key": "Content-Security-Policy",
"value": "default-src 'self'; script-src 'self'; connect-src 'self' https://ecosystem.seam.co; img-src 'self' data: https://seam-ecosystem-media.fly.storage.tigris.dev https://strapi-media-bucket.fly.storage.tigris.dev; style-src 'self'; frame-ancestors 'self' https://www.seam.co https://seam.co https://docs.seam.co https://*.mintlify.app http://localhost:* http://127.0.0.1:*"
"value": "default-src 'self'; script-src 'self'; connect-src 'self'; img-src 'self' data: https://seam-ecosystem-media.fly.storage.tigris.dev https://strapi-media-bucket.fly.storage.tigris.dev; style-src 'self'; frame-ancestors 'self' https://www.seam.co https://seam.co https://docs.seam.co https://*.mintlify.app http://localhost:* http://127.0.0.1:*"
},
{
"key": "X-Robots-Tag",
Expand Down
Loading