@bounded-sh/core 0.0.9 → 0.0.11

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.
@@ -85,8 +85,3 @@ export declare function wsQuery(path: string, opts?: {
85
85
  }): Promise<any>;
86
86
  export declare function wsDelete(path: string): Promise<any>;
87
87
  export declare function wsGetMany(paths: string[]): Promise<any>;
88
- declare global {
89
- interface Window {
90
- CUSTOM_BOUNDED_APP_ID_HEADER?: string;
91
- }
92
- }
@@ -57,8 +57,3 @@ export declare function getCachedData(path: string, prompt?: string): any | null
57
57
  * Existing subscriptions will receive new initial data after reconnection.
58
58
  */
59
59
  export declare function reconnectWithNewAuth(): Promise<void>;
60
- declare global {
61
- interface Window {
62
- CUSTOM_BOUNDED_APP_ID_HEADER?: string;
63
- }
64
- }
package/dist/index.js CHANGED
@@ -4164,13 +4164,6 @@ async function makeApiRequest(method, urlPath, data, _overrides) {
4164
4164
  ? await _overrides._getAuthHeaders()
4165
4165
  : await createAuthHeader(config.isServer);
4166
4166
  const headers = Object.assign({ "Content-Type": "application/json", "X-Public-App-Id": config.appId, "X-App-Id": config.appId }, authHeader);
4167
- if (typeof window !== "undefined" &&
4168
- window.CUSTOM_BOUNDED_APP_ID_HEADER) {
4169
- const customAppId = window.CUSTOM_BOUNDED_APP_ID_HEADER;
4170
- if (customAppId) {
4171
- headers["X-App-Id"] = customAppId;
4172
- }
4173
- }
4174
4167
  // Apply custom headers from _overrides
4175
4168
  if (_overrides === null || _overrides === void 0 ? void 0 : _overrides.headers) {
4176
4169
  Object.assign(headers, _overrides.headers);
@@ -5883,17 +5876,10 @@ async function getOrCreateConnection(appId, isServer, routePath, authTokenProvid
5883
5876
  const wsUrl = new URL(config.wsApiUrl);
5884
5877
  // Always use v2 path
5885
5878
  wsUrl.pathname = WS_V2_PATH;
5886
- // Set appId prefer the explicit appId passed to getOrCreateConnection,
5887
- // fall back to window global for legacy callers, then config default
5888
- if (appId && appId !== config.appId) {
5889
- wsUrl.searchParams.append('appId', appId);
5890
- }
5891
- else if (typeof window !== 'undefined' && window.CUSTOM_BOUNDED_APP_ID_HEADER) {
5892
- wsUrl.searchParams.append('appId', window.CUSTOM_BOUNDED_APP_ID_HEADER);
5893
- }
5894
- else {
5895
- wsUrl.searchParams.append('appId', config.appId);
5896
- }
5879
+ // Set appId from the configured SDK source, or an explicit per-call
5880
+ // override passed through subscribeV2. Do not consult ambient globals:
5881
+ // app identity must come from init({ appId }) or an explicit call option.
5882
+ wsUrl.searchParams.append('appId', appId || config.appId);
5897
5883
  // Per-room connection: carry the room path so the worker routes this WS
5898
5884
  // to the room DO (appId#room#roomId) where the live view fan-out lives.
5899
5885
  if (connection.routePath) {