@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/README.md +85 -114
- package/dist/auth/authConfig.d.ts +1 -1
- package/dist/auth/index.d.ts +2 -3
- package/dist/auth/index.d.ts.map +1 -1
- package/dist/index.cjs +9 -9
- package/dist/index.mjs +317 -331
- package/package.json +1 -1
- package/sdk/auth/authConfig.ts +4 -4
- package/sdk/auth/index.ts +2 -21
package/package.json
CHANGED
package/sdk/auth/authConfig.ts
CHANGED
|
@@ -18,14 +18,14 @@ const defaultAuthConfig: AuthConfig = {
|
|
|
18
18
|
},
|
|
19
19
|
},
|
|
20
20
|
defaultProvider: "google",
|
|
21
|
-
autoRedirect:
|
|
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:
|
|
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
|
|
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
|
-
//
|
|
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";
|