@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 +13 -10
- package/dist/index.d.ts +13 -10
- package/dist/index.js +12 -51513
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +12 -51512
- package/dist/index.mjs.map +1 -1
- package/dist/next-js.js +6 -7709
- package/dist/next-js.js.map +1 -1
- package/dist/next-js.mjs +1 -7712
- package/dist/next-js.mjs.map +1 -1
- package/dist/react.js +6 -1640
- package/dist/react.js.map +1 -1
- package/dist/react.mjs +1 -1643
- package/dist/react.mjs.map +1 -1
- package/package.json +7 -7
package/dist/index.d.mts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
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():
|
|
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<
|
|
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<
|
|
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<
|
|
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 {
|
|
131
|
+
* import { KrutAuth } from "@krutai/auth";
|
|
133
132
|
*
|
|
134
|
-
* export const auth =
|
|
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.
|
|
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
|
|
2
|
-
|
|
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():
|
|
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<
|
|
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<
|
|
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<
|
|
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 {
|
|
131
|
+
* import { KrutAuth } from "@krutai/auth";
|
|
133
132
|
*
|
|
134
|
-
* export const auth =
|
|
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.
|
|
154
|
+
declare const VERSION = "0.1.5";
|
|
152
155
|
|
|
153
156
|
export { type AuthSession, KrutAuth, type KrutAuthConfig, VERSION };
|