@krutai/auth 0.1.4 → 0.1.6

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.d.mts CHANGED
@@ -1,6 +1,5 @@
1
- import * as better_auth from 'better-auth';
2
- import { BetterAuthOptions, betterAuth } from 'better-auth';
3
- export { BetterAuthOptions, betterAuth } from 'better-auth';
1
+ import { BetterAuthOptions, Auth } from 'better-auth';
2
+ export { BetterAuthOptions } from 'better-auth';
4
3
  export { ApiKeyValidationError, createApiKeyChecker, validateApiKeyFormat, validateApiKeyWithService } from 'krutai';
5
4
 
6
5
  /**
@@ -94,7 +93,7 @@ declare class KrutAuth {
94
93
  * Get the Better Auth instance
95
94
  * @throws {Error} If not initialized
96
95
  */
97
- getBetterAuth(): ReturnType<typeof betterAuth>;
96
+ getBetterAuth(): Auth;
98
97
  /**
99
98
  * Check if the client is initialized
100
99
  */
@@ -109,17 +108,17 @@ declare class KrutAuth {
109
108
  * This is a convenience method that wraps Better Auth
110
109
  * You can access the full Better Auth API via getBetterAuth()
111
110
  */
112
- signIn(): Promise<better_auth.Auth<better_auth.BetterAuthOptions>>;
111
+ signIn(): Promise<Auth>;
113
112
  /**
114
113
  * Sign out the current user
115
114
  * You can access the full Better Auth API via getBetterAuth()
116
115
  */
117
- signOut(): Promise<better_auth.Auth<better_auth.BetterAuthOptions>>;
116
+ signOut(): Promise<Auth>;
118
117
  /**
119
118
  * Get the current session
120
119
  * You can access the full Better Auth API via getBetterAuth()
121
120
  */
122
- getSession(): Promise<better_auth.Auth<better_auth.BetterAuthOptions>>;
121
+ getSession(): Promise<Auth>;
123
122
  }
124
123
 
125
124
  /**
@@ -129,9 +128,13 @@ declare class KrutAuth {
129
128
  *
130
129
  * @example Server-side (Next.js API route / server component)
131
130
  * ```typescript
132
- * import { betterAuth } from "@krutai/auth";
131
+ * import { KrutAuth } from "@krutai/auth";
133
132
  *
134
- * export const auth = betterAuth({ ... });
133
+ * export const auth = new KrutAuth({
134
+ * apiKey: process.env.KRUTAI_API_KEY!,
135
+ * betterAuthOptions: { ... },
136
+ * });
137
+ * await auth.initialize();
135
138
  * ```
136
139
  *
137
140
  * @example Client-side (React / Next.js client component)
@@ -148,6 +151,6 @@ declare class KrutAuth {
148
151
  * @packageDocumentation
149
152
  */
150
153
 
151
- declare const VERSION = "0.1.2";
154
+ declare const VERSION = "0.1.5";
152
155
 
153
156
  export { type AuthSession, KrutAuth, type KrutAuthConfig, VERSION };
package/dist/index.d.ts CHANGED
@@ -1,6 +1,5 @@
1
- import * as better_auth from 'better-auth';
2
- import { BetterAuthOptions, betterAuth } from 'better-auth';
3
- export { BetterAuthOptions, betterAuth } from 'better-auth';
1
+ import { BetterAuthOptions, Auth } from 'better-auth';
2
+ export { BetterAuthOptions } from 'better-auth';
4
3
  export { ApiKeyValidationError, createApiKeyChecker, validateApiKeyFormat, validateApiKeyWithService } from 'krutai';
5
4
 
6
5
  /**
@@ -94,7 +93,7 @@ declare class KrutAuth {
94
93
  * Get the Better Auth instance
95
94
  * @throws {Error} If not initialized
96
95
  */
97
- getBetterAuth(): ReturnType<typeof betterAuth>;
96
+ getBetterAuth(): Auth;
98
97
  /**
99
98
  * Check if the client is initialized
100
99
  */
@@ -109,17 +108,17 @@ declare class KrutAuth {
109
108
  * This is a convenience method that wraps Better Auth
110
109
  * You can access the full Better Auth API via getBetterAuth()
111
110
  */
112
- signIn(): Promise<better_auth.Auth<better_auth.BetterAuthOptions>>;
111
+ signIn(): Promise<Auth>;
113
112
  /**
114
113
  * Sign out the current user
115
114
  * You can access the full Better Auth API via getBetterAuth()
116
115
  */
117
- signOut(): Promise<better_auth.Auth<better_auth.BetterAuthOptions>>;
116
+ signOut(): Promise<Auth>;
118
117
  /**
119
118
  * Get the current session
120
119
  * You can access the full Better Auth API via getBetterAuth()
121
120
  */
122
- getSession(): Promise<better_auth.Auth<better_auth.BetterAuthOptions>>;
121
+ getSession(): Promise<Auth>;
123
122
  }
124
123
 
125
124
  /**
@@ -129,9 +128,13 @@ declare class KrutAuth {
129
128
  *
130
129
  * @example Server-side (Next.js API route / server component)
131
130
  * ```typescript
132
- * import { betterAuth } from "@krutai/auth";
131
+ * import { KrutAuth } from "@krutai/auth";
133
132
  *
134
- * export const auth = betterAuth({ ... });
133
+ * export const auth = new KrutAuth({
134
+ * apiKey: process.env.KRUTAI_API_KEY!,
135
+ * betterAuthOptions: { ... },
136
+ * });
137
+ * await auth.initialize();
135
138
  * ```
136
139
  *
137
140
  * @example Client-side (React / Next.js client component)
@@ -148,6 +151,6 @@ declare class KrutAuth {
148
151
  * @packageDocumentation
149
152
  */
150
153
 
151
- declare const VERSION = "0.1.2";
154
+ declare const VERSION = "0.1.5";
152
155
 
153
156
  export { type AuthSession, KrutAuth, type KrutAuthConfig, VERSION };