diff --git a/package-lock.json b/package-lock.json index c3aff0f..2822ba2 100644 --- a/package-lock.json +++ b/package-lock.json @@ -12,8 +12,8 @@ "uuid": "^14.0.1" }, "devDependencies": { - "@seamapi/fake-seam-connect": "^1.76.0", - "@seamapi/http": "^2.5.0", + "@seamapi/fake-seam-connect": "^2.0.4", + "@seamapi/http": "^2.5.1", "@tanstack/react-query": "^5.27.5", "@testing-library/react": "^16.3.0", "@types/node": "^24.10.9", @@ -793,106 +793,28 @@ "dev": true, "license": "MIT" }, - "node_modules/@seamapi/fake-devicedb": { - "version": "1.6.1", - "resolved": "https://registry.npmjs.org/@seamapi/fake-devicedb/-/fake-devicedb-1.6.1.tgz", - "integrity": "sha512-w4Ar/s2kPnE5ExJSlpD3sKL8lkF+rLHRROArIRxtR2reHfnDSVwnDt9TzBYkHqgMP/x4o7LUzlRRpobn2xn24A==", - "dev": true, - "license": "MIT", - "optional": true, - "engines": { - "node": ">=18.12.0", - "npm": ">= 9.0.0" - }, - "optionalDependencies": { - "zod": "^3.21.4", - "zustand": "^4.3.7", - "zustand-hoist": "^2.0.0" - } - }, - "node_modules/@seamapi/fake-devicedb/node_modules/zustand": { - "version": "4.5.7", - "resolved": "https://registry.npmjs.org/zustand/-/zustand-4.5.7.tgz", - "integrity": "sha512-CHOUy7mu3lbD6o6LJLfllpjkzhHXSBlX8B9+qPddUsIfeF5S/UZ5q0kmCsnRqT1UHFQZchNFDDzMbQsuesHWlw==", - "dev": true, - "license": "MIT", - "optional": true, - "dependencies": { - "use-sync-external-store": "^1.2.2" - }, - "engines": { - "node": ">=12.7.0" - }, - "peerDependencies": { - "@types/react": ">=16.8", - "immer": ">=9.0.6", - "react": ">=16.8" - }, - "peerDependenciesMeta": { - "@types/react": { - "optional": true - }, - "immer": { - "optional": true - }, - "react": { - "optional": true - } - } - }, "node_modules/@seamapi/fake-seam-connect": { - "version": "1.86.0", - "resolved": "https://registry.npmjs.org/@seamapi/fake-seam-connect/-/fake-seam-connect-1.86.0.tgz", - "integrity": "sha512-iO5fwtSIPhzmIiLxrFDtCYF/7HTb+ywcGmc3WzWt8Sr0bLQlmwCyTJ8YYZy++Hx0FsnNpa5AmlJuJGul9Y5gZA==", + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/@seamapi/fake-seam-connect/-/fake-seam-connect-2.0.4.tgz", + "integrity": "sha512-pgPUhIMW462B3jIWTuhH/aK2wUxRuOLjhsjB7YxdXw2g+hTVRJ5w4t01spETu1g2bch3Rzffd0whUVLeC4vjwQ==", "dev": true, "license": "MIT", "bin": { "fake-seam-connect": "dist/server.js" }, "engines": { - "node": ">=18.12.0", - "npm": ">= 9.0.0" + "node": ">=22.12.0", + "npm": ">=10.0.0" }, "optionalDependencies": { - "@seamapi/fake-devicedb": ">=1.0.0-rc.0", "zustand": "^4.3.7", "zustand-hoist": "^2.0.0" } }, - "node_modules/@seamapi/fake-seam-connect/node_modules/zustand": { - "version": "4.5.7", - "resolved": "https://registry.npmjs.org/zustand/-/zustand-4.5.7.tgz", - "integrity": "sha512-CHOUy7mu3lbD6o6LJLfllpjkzhHXSBlX8B9+qPddUsIfeF5S/UZ5q0kmCsnRqT1UHFQZchNFDDzMbQsuesHWlw==", - "dev": true, - "license": "MIT", - "optional": true, - "dependencies": { - "use-sync-external-store": "^1.2.2" - }, - "engines": { - "node": ">=12.7.0" - }, - "peerDependencies": { - "@types/react": ">=16.8", - "immer": ">=9.0.6", - "react": ">=16.8" - }, - "peerDependenciesMeta": { - "@types/react": { - "optional": true - }, - "immer": { - "optional": true - }, - "react": { - "optional": true - } - } - }, "node_modules/@seamapi/http": { - "version": "2.5.0", - "resolved": "https://registry.npmjs.org/@seamapi/http/-/http-2.5.0.tgz", - "integrity": "sha512-r4RiPfItC59nae24gzDNa2fP7dQ4gkybX8E5ib9795XrpWt0wAxhile43CtcIUEjB7X21Z+ak7T4jkDIORTRwQ==", + "version": "2.5.1", + "resolved": "https://registry.npmjs.org/@seamapi/http/-/http-2.5.1.tgz", + "integrity": "sha512-08MbS77a9O14keurBTYaQNXx7vNYXVzKa7oWfQcocfLjaM3aG8b7wG71Fvv9QhiFg/e+9ClL9JL8WSNDjMaQDQ==", "dev": true, "license": "MIT", "dependencies": { @@ -7816,33 +7738,23 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/zod": { - "version": "3.25.76", - "resolved": "https://registry.npmjs.org/zod/-/zod-3.25.76.tgz", - "integrity": "sha512-gzUt/qt81nXsFGKIFcC3YnfEAx5NkunCfnDlvuBSSFS02bcXu4Lmea0AFIUwbLWxWPx3d9p8S5QoaujKcNQxcQ==", - "dev": true, - "license": "MIT", - "optional": true, - "funding": { - "url": "https://github.com/sponsors/colinhacks" - } - }, "node_modules/zustand": { - "version": "5.0.15", - "resolved": "https://registry.npmjs.org/zustand/-/zustand-5.0.15.tgz", - "integrity": "sha512-MpSEjRiBkA9crSYeOUH32rJC7SVqAbm0Fqcqge/bUi2PPoLcBWKOsG+C8mevmpr8TwXHBVkChbbJiyvkE+i/3A==", + "version": "4.5.7", + "resolved": "https://registry.npmjs.org/zustand/-/zustand-4.5.7.tgz", + "integrity": "sha512-CHOUy7mu3lbD6o6LJLfllpjkzhHXSBlX8B9+qPddUsIfeF5S/UZ5q0kmCsnRqT1UHFQZchNFDDzMbQsuesHWlw==", "dev": true, "license": "MIT", "optional": true, - "peer": true, + "dependencies": { + "use-sync-external-store": "^1.2.2" + }, "engines": { - "node": ">=12.20.0" + "node": ">=12.7.0" }, "peerDependencies": { - "@types/react": ">=18.0.0", + "@types/react": ">=16.8", "immer": ">=9.0.6", - "react": ">=18.0.0", - "use-sync-external-store": ">=1.2.0" + "react": ">=16.8" }, "peerDependenciesMeta": { "@types/react": { @@ -7853,9 +7765,6 @@ }, "react": { "optional": true - }, - "use-sync-external-store": { - "optional": true } } }, diff --git a/package.json b/package.json index 555ce99..84b57da 100644 --- a/package.json +++ b/package.json @@ -92,8 +92,8 @@ "uuid": "^14.0.1" }, "devDependencies": { - "@seamapi/fake-seam-connect": "^1.76.0", - "@seamapi/http": "^2.5.0", + "@seamapi/fake-seam-connect": "^2.0.4", + "@seamapi/http": "^2.5.1", "@tanstack/react-query": "^5.27.5", "@testing-library/react": "^16.3.0", "@types/node": "^24.10.9", diff --git a/src/lib/SeamQueryProvider.tsx b/src/lib/SeamQueryProvider.tsx index cb2629f..9737108 100644 --- a/src/lib/SeamQueryProvider.tsx +++ b/src/lib/SeamQueryProvider.tsx @@ -18,6 +18,9 @@ import { import { seamContext, type SeamQueryContext } from './seam-query-context.js' import { useSeamClient } from './use-seam-client.js' +export type { SeamQueryContext } from './seam-query-context.js' +export { seamContext, useSeamQueryContext } from './seam-query-context.js' + export type SeamQueryProviderProps = | SeamQueryProviderPropsWithClient | SeamQueryProviderPropsWithPublishableKey diff --git a/src/lib/use-seam-client.ts b/src/lib/use-seam-client.ts index 04e4773..bfd5e5c 100644 --- a/src/lib/use-seam-client.ts +++ b/src/lib/use-seam-client.ts @@ -30,6 +30,10 @@ export function useSeamClient(): { queryKeyPrefix, ...context } = useSeamQueryContext() + const seamClientOptions = + clientOptions?.endpoint == null + ? undefined + : { endpoint: clientOptions.endpoint } const userIdentifierKey = useUserIdentifierKeyOrFingerprint( clientSessionToken != null ? '' : context.userIdentifierKey, ) @@ -64,7 +68,7 @@ export function useSeamClient(): { if (clientSessionToken != null) { const seam = SeamHttp.fromClientSessionToken( clientSessionToken, - clientOptions, + seamClientOptions, ) return { @@ -79,7 +83,7 @@ export function useSeamClient(): { const seam = await SeamHttp.fromPublishableKey( publishableKey, userIdentifierKey, - clientOptions, + seamClientOptions, ) return { @@ -94,7 +98,7 @@ export function useSeamClient(): { const clientWithoutWorkspace = SeamHttpWithoutWorkspace.fromConsoleSessionToken( consoleSessionToken, - clientOptions, + seamClientOptions, ) const endpointClientWithoutWorkspace = @@ -114,7 +118,7 @@ export function useSeamClient(): { const seam = SeamHttp.fromConsoleSessionToken( consoleSessionToken, workspaceId, - clientOptions, + seamClientOptions, ) return {