hyperstack-react 0.6.5 → 0.6.7

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.
package/dist/index.esm.js CHANGED
@@ -6976,9 +6976,8 @@ class ConnectionManager {
6976
6976
  if (this.authConfig?.tokenEndpoint) {
6977
6977
  return this.authConfig.tokenEndpoint;
6978
6978
  }
6979
- // Always use the default hosted token endpoint for hosted URLs,
6980
- // even without a publishableKey - some endpoints don't require auth
6981
- if (this.hostedHyperstackUrl) {
6979
+ // Require publishableKey for hosted token endpoint
6980
+ if (this.hostedHyperstackUrl && this.authConfig?.publishableKey) {
6982
6981
  return DEFAULT_HOSTED_TOKEN_ENDPOINT;
6983
6982
  }
6984
6983
  return undefined;
@@ -7022,6 +7021,11 @@ class ConnectionManager {
7022
7021
  return this.currentToken;
7023
7022
  }
7024
7023
  const strategy = this.getAuthStrategy();
7024
+ // For hosted Hyperstack URLs, auth is required - fail early with clear message
7025
+ if (strategy.kind === 'none' && this.hostedHyperstackUrl) {
7026
+ throw new HyperStackError('Hyperstack authentication required. Please provide auth.publishableKey to HyperstackProvider. ' +
7027
+ 'Get your key from https://usehyperstack.com/dashboard', 'AUTH_REQUIRED');
7028
+ }
7025
7029
  switch (strategy.kind) {
7026
7030
  case 'static-token':
7027
7031
  return this.updateTokenState(strategy.token);