@ram_28/kf-ai-sdk 1.0.3 → 1.0.5

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ram_28/kf-ai-sdk",
3
- "version": "1.0.3",
3
+ "version": "1.0.5",
4
4
  "description": "Type-safe, AI-driven SDK for building modern web applications with role-based access control",
5
5
  "author": "Ramprasad",
6
6
  "license": "MIT",
@@ -18,14 +18,14 @@ const defaultAuthConfig: AuthConfig = {
18
18
  },
19
19
  },
20
20
  defaultProvider: "google",
21
- autoRedirect: true,
21
+ autoRedirect: false,
22
22
  sessionCheckInterval: 0,
23
23
  retry: {
24
24
  count: 3,
25
25
  delay: 1000,
26
26
  },
27
27
  staleTime: 5 * 60 * 1000,
28
- refetchOnWindowFocus: true,
28
+ refetchOnWindowFocus: false,
29
29
  refetchOnReconnect: true,
30
30
  };
31
31
 
@@ -82,10 +82,10 @@ export function getAuthConfig(): Readonly<AuthConfig> {
82
82
 
83
83
  /**
84
84
  * Get the base URL for auth endpoints
85
- * Falls back to API base URL if not explicitly set
85
+ * Falls back to API base URL, then window.location.origin
86
86
  */
87
87
  export function getAuthBaseUrl(): string {
88
- return authConfig.baseUrl || getApiBaseUrl();
88
+ return authConfig.baseUrl || getApiBaseUrl() || (typeof window !== 'undefined' ? window.location.origin : '');
89
89
  }
90
90
 
91
91
  /**
package/sdk/auth/index.ts CHANGED
@@ -8,33 +8,14 @@ export { AuthProvider } from "./AuthProvider";
8
8
  // Main hook
9
9
  export { useAuth } from "./useAuth";
10
10
 
11
- // Configuration functions
12
- export {
13
- configureAuth,
14
- setAuthProvider,
15
- getAuthConfig,
16
- getAuthBaseUrl,
17
- resetAuthConfig,
18
- } from "./authConfig";
19
-
20
- // API client functions (for advanced use cases)
21
- export {
22
- fetchSession,
23
- initiateLogin,
24
- performLogout,
25
- AuthenticationError,
26
- } from "./authClient";
11
+ // Error class (for error handling)
12
+ export { AuthenticationError } from "./authClient";
27
13
 
28
14
  // Type exports
29
15
  export type {
30
16
  UserDetails,
31
17
  SessionResponse,
32
18
  AuthStatus,
33
- AuthConfig,
34
- AuthProviderName,
35
- AuthEndpointConfig,
36
19
  AuthProviderProps,
37
20
  UseAuthReturn,
38
- LoginOptions,
39
- LogoutOptions,
40
21
  } from "./types";