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