glitch-javascript-sdk 3.9.1 → 3.9.3

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.
@@ -5787,8 +5787,16 @@
5787
5787
  static aiInstructions(title_id, site_id, data = {}) {
5788
5788
  return Requests.processRoute(HostingRoute.routes.aiInstructions, data, { title_id, site_id });
5789
5789
  }
5790
- static resolve(hostname) {
5791
- return Requests.processRoute(HostingRoute.routes.resolve, undefined, undefined, { hostname });
5790
+ static resolve(hostname, gatewayToken) {
5791
+ if (!gatewayToken) {
5792
+ return Requests.processRoute(HostingRoute.routes.resolve, undefined, undefined, { hostname });
5793
+ }
5794
+ const base = (Config.getBaseUrl() || '').replace(/\/+$/, '');
5795
+ const path = HostingRoute.routes.resolve.url.replace(/^\/+/, '');
5796
+ return axios$1.get(`${base}/${path}`, {
5797
+ params: { hostname },
5798
+ headers: { 'X-Glitch-Hosting-Gateway': gatewayToken },
5799
+ });
5792
5800
  }
5793
5801
  static startPlaySession(data) {
5794
5802
  return Requests.processRoute(HostingRoute.routes.startPlaySession, data);
@@ -5840,7 +5848,8 @@
5840
5848
  return session;
5841
5849
  }).catch((error) => {
5842
5850
  window.dispatchEvent(new CustomEvent('glitch:hosting-error', { detail: { message: (error === null || error === void 0 ? void 0 : error.message) || 'Hosting analytics could not start.' } }));
5843
- throw error;
5851
+ // Analytics must never prevent the uploaded game itself from loading.
5852
+ return null;
5844
5853
  });
5845
5854
  window.GlitchHosting = {
5846
5855
  ready,