@resultdev/sdk 0.3.0 → 0.3.1

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/CHANGELOG.md CHANGED
@@ -1,5 +1,16 @@
1
1
  # @resultdev/sdk
2
2
 
3
+ ## 0.3.1
4
+
5
+ - A missing `baseUrl` now throws `MISSING_BASE_URL` at client construction
6
+ instead of silently falling back to a localhost dev URL. The fallback made
7
+ deployed sites whose `NEXT_PUBLIC_BACKEND_URL` was undefined in the
8
+ browser bundle (for example when the env var is read through an imported
9
+ `process` module, which defeats build-time inlining) call `localhost` from
10
+ production pages, which surfaced as Chrome's "access other apps and
11
+ services on this device" permission prompt. The error's fix hint names the
12
+ env var and the inlining rule.
13
+
3
14
  ## 0.3.0
4
15
 
5
16
  Reliability release: every fix here comes from live verification against a
@@ -1,4 +1,4 @@
1
- import { e as AuthSession, U as UserSchema, a as ResultConfig, G as AuthRefreshResponse, C as ChatCompletionRequest, B as ToolCall, H as Annotation, I as ImageGenerationRequest, j as EmbeddingsRequest, J as EmbeddingObject, h as CreateUserRequest, K as CreateUserResponse, o as ResultError, g as CreateSessionRequest, L as CreateSessionResponse, l as OAuthProvidersSchema, M as RefreshSessionResponse, N as GetProfileResponse, Q as SendVerificationEmailRequest, V as VerifyEmailRequest, W as VerifyEmailResponse, X as SendResetPasswordEmailRequest, Y as ExchangeResetPasswordTokenRequest, Z as ExchangeResetPasswordTokenResponse, _ as ResetPasswordResponse, $ as GetPublicAuthConfigResponse, S as SendRawEmailRequest, q as SendEmailResponse, v as SubscribeResponse, r as SocketMessage, P as PresenceMember, u as StorageFileSchema, a0 as ListObjectsResponseSchema, i as DeleteObjectsResponse, A as Analytics, w as Support } from './types-DSVtGaIA.cjs';
1
+ import { e as AuthSession, U as UserSchema, a as ResultConfig, G as AuthRefreshResponse, C as ChatCompletionRequest, B as ToolCall, H as Annotation, I as ImageGenerationRequest, j as EmbeddingsRequest, J as EmbeddingObject, h as CreateUserRequest, K as CreateUserResponse, o as ResultError, g as CreateSessionRequest, L as CreateSessionResponse, l as OAuthProvidersSchema, M as RefreshSessionResponse, N as GetProfileResponse, Q as SendVerificationEmailRequest, V as VerifyEmailRequest, W as VerifyEmailResponse, X as SendResetPasswordEmailRequest, Y as ExchangeResetPasswordTokenRequest, Z as ExchangeResetPasswordTokenResponse, _ as ResetPasswordResponse, $ as GetPublicAuthConfigResponse, S as SendRawEmailRequest, q as SendEmailResponse, v as SubscribeResponse, r as SocketMessage, P as PresenceMember, u as StorageFileSchema, a0 as ListObjectsResponseSchema, i as DeleteObjectsResponse, A as Analytics, w as Support } from './types-BmU3deRO.js';
2
2
  import * as _supabase_postgrest_js from '@supabase/postgrest-js';
3
3
  import { PostgrestClient } from '@supabase/postgrest-js';
4
4
 
@@ -996,7 +996,7 @@ type AccessTokenChangeEvent = typeof AuthChangeEvent.SIGNED_IN | typeof AuthChan
996
996
  * import { ResultClient } from '@resultdev/sdk';
997
997
  *
998
998
  * const client = new ResultClient({
999
- * baseUrl: 'http://localhost:7130'
999
+ * baseUrl: process.env.NEXT_PUBLIC_BACKEND_URL!
1000
1000
  * });
1001
1001
  *
1002
1002
  * // Authentication
@@ -1027,7 +1027,7 @@ type AccessTokenChangeEvent = typeof AuthChangeEvent.SIGNED_IN | typeof AuthChan
1027
1027
  *
1028
1028
  * // Enable debug logging
1029
1029
  * const debugClient = new ResultClient({
1030
- * baseUrl: 'http://localhost:7130',
1030
+ * baseUrl: process.env.NEXT_PUBLIC_BACKEND_URL!,
1031
1031
  * debug: true
1032
1032
  * });
1033
1033
  * ```
@@ -1,4 +1,4 @@
1
- import { e as AuthSession, U as UserSchema, a as ResultConfig, G as AuthRefreshResponse, C as ChatCompletionRequest, B as ToolCall, H as Annotation, I as ImageGenerationRequest, j as EmbeddingsRequest, J as EmbeddingObject, h as CreateUserRequest, K as CreateUserResponse, o as ResultError, g as CreateSessionRequest, L as CreateSessionResponse, l as OAuthProvidersSchema, M as RefreshSessionResponse, N as GetProfileResponse, Q as SendVerificationEmailRequest, V as VerifyEmailRequest, W as VerifyEmailResponse, X as SendResetPasswordEmailRequest, Y as ExchangeResetPasswordTokenRequest, Z as ExchangeResetPasswordTokenResponse, _ as ResetPasswordResponse, $ as GetPublicAuthConfigResponse, S as SendRawEmailRequest, q as SendEmailResponse, v as SubscribeResponse, r as SocketMessage, P as PresenceMember, u as StorageFileSchema, a0 as ListObjectsResponseSchema, i as DeleteObjectsResponse, A as Analytics, w as Support } from './types-DSVtGaIA.js';
1
+ import { e as AuthSession, U as UserSchema, a as ResultConfig, G as AuthRefreshResponse, C as ChatCompletionRequest, B as ToolCall, H as Annotation, I as ImageGenerationRequest, j as EmbeddingsRequest, J as EmbeddingObject, h as CreateUserRequest, K as CreateUserResponse, o as ResultError, g as CreateSessionRequest, L as CreateSessionResponse, l as OAuthProvidersSchema, M as RefreshSessionResponse, N as GetProfileResponse, Q as SendVerificationEmailRequest, V as VerifyEmailRequest, W as VerifyEmailResponse, X as SendResetPasswordEmailRequest, Y as ExchangeResetPasswordTokenRequest, Z as ExchangeResetPasswordTokenResponse, _ as ResetPasswordResponse, $ as GetPublicAuthConfigResponse, S as SendRawEmailRequest, q as SendEmailResponse, v as SubscribeResponse, r as SocketMessage, P as PresenceMember, u as StorageFileSchema, a0 as ListObjectsResponseSchema, i as DeleteObjectsResponse, A as Analytics, w as Support } from './types-BmU3deRO.cjs';
2
2
  import * as _supabase_postgrest_js from '@supabase/postgrest-js';
3
3
  import { PostgrestClient } from '@supabase/postgrest-js';
4
4
 
@@ -996,7 +996,7 @@ type AccessTokenChangeEvent = typeof AuthChangeEvent.SIGNED_IN | typeof AuthChan
996
996
  * import { ResultClient } from '@resultdev/sdk';
997
997
  *
998
998
  * const client = new ResultClient({
999
- * baseUrl: 'http://localhost:7130'
999
+ * baseUrl: process.env.NEXT_PUBLIC_BACKEND_URL!
1000
1000
  * });
1001
1001
  *
1002
1002
  * // Authentication
@@ -1027,7 +1027,7 @@ type AccessTokenChangeEvent = typeof AuthChangeEvent.SIGNED_IN | typeof AuthChan
1027
1027
  *
1028
1028
  * // Enable debug logging
1029
1029
  * const debugClient = new ResultClient({
1030
- * baseUrl: 'http://localhost:7130',
1030
+ * baseUrl: process.env.NEXT_PUBLIC_BACKEND_URL!,
1031
1031
  * debug: true
1032
1032
  * });
1033
1033
  * ```
package/dist/index.cjs CHANGED
@@ -503,7 +503,15 @@ var HttpClient = class {
503
503
  */
504
504
  constructor(config, tokenManager, logger) {
505
505
  this.config = config;
506
- this.baseUrl = config.baseUrl || "http://localhost:7130";
506
+ if (!config.baseUrl) {
507
+ throw new ResultError(
508
+ "createClient needs a baseUrl, but it was undefined at runtime.",
509
+ 0,
510
+ "MISSING_BASE_URL",
511
+ "Pass the NEXT_PUBLIC_BACKEND_URL value from .env.local. In browser code, write process.env.NEXT_PUBLIC_BACKEND_URL as a literal expression (never through an imported process module) so the bundler inlines it, and set it as a deployments build variable before deploying."
512
+ );
513
+ }
514
+ this.baseUrl = config.baseUrl;
507
515
  this.fetch = config.fetch || (globalThis.fetch ? globalThis.fetch.bind(globalThis) : void 0);
508
516
  this.anonKey = config.anonKey;
509
517
  this.defaultHeaders = {
package/dist/index.d.cts CHANGED
@@ -1,7 +1,7 @@
1
- import { R as ResultClient } from './client-CJv_awPt.cjs';
2
- export { A as AI, a as AccessTokenChangeEvent, b as Auth, c as AuthChangeEvent, d as AuthStateChangeCallback, C as ChatCompletion, e as ChatCompletionChoice, f as ChatCompletionChunk, g as ChatCompletionUsage, h as ConnectionState, D as Database, E as Emails, i as EmbeddingsResult, j as EventCallback, F as FunctionInvokeOptions, k as Functions, H as HttpClient, I as ImageGenerationResult, L as Logger, l as Realtime, S as Storage, m as StorageBucket, n as StorageResponse } from './client-CJv_awPt.cjs';
3
- import { R as ResultAdminConfig, a as ResultConfig } from './types-DSVtGaIA.cjs';
4
- export { A as Analytics, b as AnalyticsOptions, c as ApiError, d as AuthErrorResponse, e as AuthSession, C as ChatCompletionRequest, f as ChatMessageSchema, g as CreateSessionRequest, h as CreateUserRequest, D as DeleteObjectResult, i as DeleteObjectsResponse, E as ERROR_CODES, j as EmbeddingsRequest, k as ErrorCode, I as ImageGenerationRequest, O as OAUTH_PROVIDERS, l as OAuthProvidersSchema, P as PresenceMember, m as ProfileSchema, n as RealtimeErrorPayload, o as ResultError, p as ResultErrorCode, S as SendEmailOptions, q as SendEmailResponse, r as SocketMessage, s as StartThreadOptions, t as StartedThread, u as StorageFileSchema, v as SubscribeResponse, w as Support, x as SupportMessage, y as SupportOptions, z as SupportThread, T as Tool, B as ToolCall, F as ToolChoice, U as UserSchema } from './types-DSVtGaIA.cjs';
1
+ import { R as ResultClient } from './client-BrOD2EO5.cjs';
2
+ export { A as AI, a as AccessTokenChangeEvent, b as Auth, c as AuthChangeEvent, d as AuthStateChangeCallback, C as ChatCompletion, e as ChatCompletionChoice, f as ChatCompletionChunk, g as ChatCompletionUsage, h as ConnectionState, D as Database, E as Emails, i as EmbeddingsResult, j as EventCallback, F as FunctionInvokeOptions, k as Functions, H as HttpClient, I as ImageGenerationResult, L as Logger, l as Realtime, S as Storage, m as StorageBucket, n as StorageResponse } from './client-BrOD2EO5.cjs';
3
+ import { R as ResultAdminConfig, a as ResultConfig } from './types-BmU3deRO.cjs';
4
+ export { A as Analytics, b as AnalyticsOptions, c as ApiError, d as AuthErrorResponse, e as AuthSession, C as ChatCompletionRequest, f as ChatMessageSchema, g as CreateSessionRequest, h as CreateUserRequest, D as DeleteObjectResult, i as DeleteObjectsResponse, E as ERROR_CODES, j as EmbeddingsRequest, k as ErrorCode, I as ImageGenerationRequest, O as OAUTH_PROVIDERS, l as OAuthProvidersSchema, P as PresenceMember, m as ProfileSchema, n as RealtimeErrorPayload, o as ResultError, p as ResultErrorCode, S as SendEmailOptions, q as SendEmailResponse, r as SocketMessage, s as StartThreadOptions, t as StartedThread, u as StorageFileSchema, v as SubscribeResponse, w as Support, x as SupportMessage, y as SupportOptions, z as SupportThread, T as Tool, B as ToolCall, F as ToolChoice, U as UserSchema } from './types-BmU3deRO.cjs';
5
5
  import '@supabase/postgrest-js';
6
6
 
7
7
  /**
package/dist/index.d.ts CHANGED
@@ -1,7 +1,7 @@
1
- import { R as ResultClient } from './client-DrsZ1qIm.js';
2
- export { A as AI, a as AccessTokenChangeEvent, b as Auth, c as AuthChangeEvent, d as AuthStateChangeCallback, C as ChatCompletion, e as ChatCompletionChoice, f as ChatCompletionChunk, g as ChatCompletionUsage, h as ConnectionState, D as Database, E as Emails, i as EmbeddingsResult, j as EventCallback, F as FunctionInvokeOptions, k as Functions, H as HttpClient, I as ImageGenerationResult, L as Logger, l as Realtime, S as Storage, m as StorageBucket, n as StorageResponse } from './client-DrsZ1qIm.js';
3
- import { R as ResultAdminConfig, a as ResultConfig } from './types-DSVtGaIA.js';
4
- export { A as Analytics, b as AnalyticsOptions, c as ApiError, d as AuthErrorResponse, e as AuthSession, C as ChatCompletionRequest, f as ChatMessageSchema, g as CreateSessionRequest, h as CreateUserRequest, D as DeleteObjectResult, i as DeleteObjectsResponse, E as ERROR_CODES, j as EmbeddingsRequest, k as ErrorCode, I as ImageGenerationRequest, O as OAUTH_PROVIDERS, l as OAuthProvidersSchema, P as PresenceMember, m as ProfileSchema, n as RealtimeErrorPayload, o as ResultError, p as ResultErrorCode, S as SendEmailOptions, q as SendEmailResponse, r as SocketMessage, s as StartThreadOptions, t as StartedThread, u as StorageFileSchema, v as SubscribeResponse, w as Support, x as SupportMessage, y as SupportOptions, z as SupportThread, T as Tool, B as ToolCall, F as ToolChoice, U as UserSchema } from './types-DSVtGaIA.js';
1
+ import { R as ResultClient } from './client--Xjaaw1l.js';
2
+ export { A as AI, a as AccessTokenChangeEvent, b as Auth, c as AuthChangeEvent, d as AuthStateChangeCallback, C as ChatCompletion, e as ChatCompletionChoice, f as ChatCompletionChunk, g as ChatCompletionUsage, h as ConnectionState, D as Database, E as Emails, i as EmbeddingsResult, j as EventCallback, F as FunctionInvokeOptions, k as Functions, H as HttpClient, I as ImageGenerationResult, L as Logger, l as Realtime, S as Storage, m as StorageBucket, n as StorageResponse } from './client--Xjaaw1l.js';
3
+ import { R as ResultAdminConfig, a as ResultConfig } from './types-BmU3deRO.js';
4
+ export { A as Analytics, b as AnalyticsOptions, c as ApiError, d as AuthErrorResponse, e as AuthSession, C as ChatCompletionRequest, f as ChatMessageSchema, g as CreateSessionRequest, h as CreateUserRequest, D as DeleteObjectResult, i as DeleteObjectsResponse, E as ERROR_CODES, j as EmbeddingsRequest, k as ErrorCode, I as ImageGenerationRequest, O as OAUTH_PROVIDERS, l as OAuthProvidersSchema, P as PresenceMember, m as ProfileSchema, n as RealtimeErrorPayload, o as ResultError, p as ResultErrorCode, S as SendEmailOptions, q as SendEmailResponse, r as SocketMessage, s as StartThreadOptions, t as StartedThread, u as StorageFileSchema, v as SubscribeResponse, w as Support, x as SupportMessage, y as SupportOptions, z as SupportThread, T as Tool, B as ToolCall, F as ToolChoice, U as UserSchema } from './types-BmU3deRO.js';
5
5
  import '@supabase/postgrest-js';
6
6
 
7
7
  /**
package/dist/index.js CHANGED
@@ -448,7 +448,15 @@ var HttpClient = class {
448
448
  */
449
449
  constructor(config, tokenManager, logger) {
450
450
  this.config = config;
451
- this.baseUrl = config.baseUrl || "http://localhost:7130";
451
+ if (!config.baseUrl) {
452
+ throw new ResultError(
453
+ "createClient needs a baseUrl, but it was undefined at runtime.",
454
+ 0,
455
+ "MISSING_BASE_URL",
456
+ "Pass the NEXT_PUBLIC_BACKEND_URL value from .env.local. In browser code, write process.env.NEXT_PUBLIC_BACKEND_URL as a literal expression (never through an imported process module) so the bundler inlines it, and set it as a deployments build variable before deploying."
457
+ );
458
+ }
459
+ this.baseUrl = config.baseUrl;
452
460
  this.fetch = config.fetch || (globalThis.fetch ? globalThis.fetch.bind(globalThis) : void 0);
453
461
  this.anonKey = config.anonKey;
454
462
  this.defaultHeaders = {
@@ -1,4 +1,4 @@
1
- import { a as ResultConfig, o as ResultError } from './types-DSVtGaIA.js';
1
+ import { a as ResultConfig, o as ResultError } from './types-BmU3deRO.js';
2
2
 
3
3
  declare const DEFAULT_ACCESS_TOKEN_COOKIE = "result_access_token";
4
4
  declare const DEFAULT_REFRESH_TOKEN_COOKIE = "result_refresh_token";
@@ -1,4 +1,4 @@
1
- import { a as ResultConfig, o as ResultError } from './types-DSVtGaIA.cjs';
1
+ import { a as ResultConfig, o as ResultError } from './types-BmU3deRO.cjs';
2
2
 
3
3
  declare const DEFAULT_ACCESS_TOKEN_COOKIE = "result_access_token";
4
4
  declare const DEFAULT_REFRESH_TOKEN_COOKIE = "result_refresh_token";
@@ -1,2 +1,2 @@
1
- export { b as AuthCookieNames, c as AuthCookieOptions, A as AuthCookieSettings, d as CookieOptions, e as CookieReader, C as CookieStore, a as CookieWriter, D as DEFAULT_ACCESS_TOKEN_COOKIE, f as DEFAULT_REFRESH_TOKEN_COOKIE, U as UpdateSessionOptions, g as UpdateSessionResult, i as clearAuthCookies, j as getAccessTokenCookieName, k as getRefreshTokenCookieName, s as setAuthCookies, u as updateSession } from '../middleware-C1Z6aMvn.cjs';
2
- import '../types-DSVtGaIA.cjs';
1
+ export { b as AuthCookieNames, c as AuthCookieOptions, A as AuthCookieSettings, d as CookieOptions, e as CookieReader, C as CookieStore, a as CookieWriter, D as DEFAULT_ACCESS_TOKEN_COOKIE, f as DEFAULT_REFRESH_TOKEN_COOKIE, U as UpdateSessionOptions, g as UpdateSessionResult, i as clearAuthCookies, j as getAccessTokenCookieName, k as getRefreshTokenCookieName, s as setAuthCookies, u as updateSession } from '../middleware-VCWoai4o.cjs';
2
+ import '../types-BmU3deRO.cjs';
@@ -1,2 +1,2 @@
1
- export { b as AuthCookieNames, c as AuthCookieOptions, A as AuthCookieSettings, d as CookieOptions, e as CookieReader, C as CookieStore, a as CookieWriter, D as DEFAULT_ACCESS_TOKEN_COOKIE, f as DEFAULT_REFRESH_TOKEN_COOKIE, U as UpdateSessionOptions, g as UpdateSessionResult, i as clearAuthCookies, j as getAccessTokenCookieName, k as getRefreshTokenCookieName, s as setAuthCookies, u as updateSession } from '../middleware-BJl9JRg3.js';
2
- import '../types-DSVtGaIA.js';
1
+ export { b as AuthCookieNames, c as AuthCookieOptions, A as AuthCookieSettings, d as CookieOptions, e as CookieReader, C as CookieStore, a as CookieWriter, D as DEFAULT_ACCESS_TOKEN_COOKIE, f as DEFAULT_REFRESH_TOKEN_COOKIE, U as UpdateSessionOptions, g as UpdateSessionResult, i as clearAuthCookies, j as getAccessTokenCookieName, k as getRefreshTokenCookieName, s as setAuthCookies, u as updateSession } from '../middleware-Uh09_lFn.js';
2
+ import '../types-BmU3deRO.js';
package/dist/ssr.cjs CHANGED
@@ -690,7 +690,15 @@ var HttpClient = class {
690
690
  */
691
691
  constructor(config, tokenManager, logger) {
692
692
  this.config = config;
693
- this.baseUrl = config.baseUrl || "http://localhost:7130";
693
+ if (!config.baseUrl) {
694
+ throw new ResultError(
695
+ "createClient needs a baseUrl, but it was undefined at runtime.",
696
+ 0,
697
+ "MISSING_BASE_URL",
698
+ "Pass the NEXT_PUBLIC_BACKEND_URL value from .env.local. In browser code, write process.env.NEXT_PUBLIC_BACKEND_URL as a literal expression (never through an imported process module) so the bundler inlines it, and set it as a deployments build variable before deploying."
699
+ );
700
+ }
701
+ this.baseUrl = config.baseUrl;
694
702
  this.fetch = config.fetch || (globalThis.fetch ? globalThis.fetch.bind(globalThis) : void 0);
695
703
  this.anonKey = config.anonKey;
696
704
  this.defaultHeaders = {
package/dist/ssr.d.cts CHANGED
@@ -1,7 +1,7 @@
1
- import { R as ResultClient } from './client-CJv_awPt.cjs';
2
- import { o as ResultError, a as ResultConfig, G as AuthRefreshResponse } from './types-DSVtGaIA.cjs';
3
- import { A as AuthCookieSettings, C as CookieStore, a as CookieWriter } from './middleware-C1Z6aMvn.cjs';
4
- export { b as AuthCookieNames, c as AuthCookieOptions, d as CookieOptions, e as CookieReader, D as DEFAULT_ACCESS_TOKEN_COOKIE, f as DEFAULT_REFRESH_TOKEN_COOKIE, U as UpdateSessionOptions, g as UpdateSessionResult, h as accessTokenCookieOptions, i as clearAuthCookies, j as getAccessTokenCookieName, k as getRefreshTokenCookieName, r as refreshTokenCookieOptions, s as setAuthCookies, u as updateSession } from './middleware-C1Z6aMvn.cjs';
1
+ import { R as ResultClient } from './client-BrOD2EO5.cjs';
2
+ import { o as ResultError, a as ResultConfig, G as AuthRefreshResponse } from './types-BmU3deRO.cjs';
3
+ import { A as AuthCookieSettings, C as CookieStore, a as CookieWriter } from './middleware-VCWoai4o.cjs';
4
+ export { b as AuthCookieNames, c as AuthCookieOptions, d as CookieOptions, e as CookieReader, D as DEFAULT_ACCESS_TOKEN_COOKIE, f as DEFAULT_REFRESH_TOKEN_COOKIE, U as UpdateSessionOptions, g as UpdateSessionResult, h as accessTokenCookieOptions, i as clearAuthCookies, j as getAccessTokenCookieName, k as getRefreshTokenCookieName, r as refreshTokenCookieOptions, s as setAuthCookies, u as updateSession } from './middleware-VCWoai4o.cjs';
5
5
  import '@supabase/postgrest-js';
6
6
 
7
7
  interface CreateAuthActionsOptions extends Omit<ResultConfig, "accessToken" | "edgeFunctionToken" | "isServerMode" | "auth">, AuthCookieSettings {
package/dist/ssr.d.ts CHANGED
@@ -1,7 +1,7 @@
1
- import { R as ResultClient } from './client-DrsZ1qIm.js';
2
- import { o as ResultError, a as ResultConfig, G as AuthRefreshResponse } from './types-DSVtGaIA.js';
3
- import { A as AuthCookieSettings, C as CookieStore, a as CookieWriter } from './middleware-BJl9JRg3.js';
4
- export { b as AuthCookieNames, c as AuthCookieOptions, d as CookieOptions, e as CookieReader, D as DEFAULT_ACCESS_TOKEN_COOKIE, f as DEFAULT_REFRESH_TOKEN_COOKIE, U as UpdateSessionOptions, g as UpdateSessionResult, h as accessTokenCookieOptions, i as clearAuthCookies, j as getAccessTokenCookieName, k as getRefreshTokenCookieName, r as refreshTokenCookieOptions, s as setAuthCookies, u as updateSession } from './middleware-BJl9JRg3.js';
1
+ import { R as ResultClient } from './client--Xjaaw1l.js';
2
+ import { o as ResultError, a as ResultConfig, G as AuthRefreshResponse } from './types-BmU3deRO.js';
3
+ import { A as AuthCookieSettings, C as CookieStore, a as CookieWriter } from './middleware-Uh09_lFn.js';
4
+ export { b as AuthCookieNames, c as AuthCookieOptions, d as CookieOptions, e as CookieReader, D as DEFAULT_ACCESS_TOKEN_COOKIE, f as DEFAULT_REFRESH_TOKEN_COOKIE, U as UpdateSessionOptions, g as UpdateSessionResult, h as accessTokenCookieOptions, i as clearAuthCookies, j as getAccessTokenCookieName, k as getRefreshTokenCookieName, r as refreshTokenCookieOptions, s as setAuthCookies, u as updateSession } from './middleware-Uh09_lFn.js';
5
5
  import '@supabase/postgrest-js';
6
6
 
7
7
  interface CreateAuthActionsOptions extends Omit<ResultConfig, "accessToken" | "edgeFunctionToken" | "isServerMode" | "auth">, AuthCookieSettings {
package/dist/ssr.js CHANGED
@@ -641,7 +641,15 @@ var HttpClient = class {
641
641
  */
642
642
  constructor(config, tokenManager, logger) {
643
643
  this.config = config;
644
- this.baseUrl = config.baseUrl || "http://localhost:7130";
644
+ if (!config.baseUrl) {
645
+ throw new ResultError(
646
+ "createClient needs a baseUrl, but it was undefined at runtime.",
647
+ 0,
648
+ "MISSING_BASE_URL",
649
+ "Pass the NEXT_PUBLIC_BACKEND_URL value from .env.local. In browser code, write process.env.NEXT_PUBLIC_BACKEND_URL as a literal expression (never through an imported process module) so the bundler inlines it, and set it as a deployments build variable before deploying."
650
+ );
651
+ }
652
+ this.baseUrl = config.baseUrl;
645
653
  this.fetch = config.fetch || (globalThis.fetch ? globalThis.fetch.bind(globalThis) : void 0);
646
654
  this.anonKey = config.anonKey;
647
655
  this.defaultHeaders = {
@@ -526,8 +526,9 @@ interface SocketMessage {
526
526
  type ResultErrorCode = ErrorCode | (string & {});
527
527
  interface ResultConfig {
528
528
  /**
529
- * The base URL of the Result backend API
530
- * @default "http://localhost:7130"
529
+ * The base URL of the Result backend API (the NEXT_PUBLIC_BACKEND_URL
530
+ * value from .env.local). Required at runtime: constructing a client
531
+ * without it throws MISSING_BASE_URL.
531
532
  */
532
533
  baseUrl?: string;
533
534
  /**
@@ -526,8 +526,9 @@ interface SocketMessage {
526
526
  type ResultErrorCode = ErrorCode | (string & {});
527
527
  interface ResultConfig {
528
528
  /**
529
- * The base URL of the Result backend API
530
- * @default "http://localhost:7130"
529
+ * The base URL of the Result backend API (the NEXT_PUBLIC_BACKEND_URL
530
+ * value from .env.local). Required at runtime: constructing a client
531
+ * without it throws MISSING_BASE_URL.
531
532
  */
532
533
  baseUrl?: string;
533
534
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@resultdev/sdk",
3
- "version": "0.3.0",
3
+ "version": "0.3.1",
4
4
  "description": "Result Backend SDK - authentication, database, storage, functions, realtime, AI, email, web analytics and customer support for apps built on Result.",
5
5
  "license": "UNLICENSED",
6
6
  "homepage": "https://docs.result.dev",