mulguard 1.0.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.
Files changed (66) hide show
  1. package/README.md +368 -0
  2. package/dist/actions-CExpv_dD.js +1 -0
  3. package/dist/actions-DeCfLtHA.mjs +184 -0
  4. package/dist/client/hooks.d.ts +122 -0
  5. package/dist/client/index.d.ts +5 -0
  6. package/dist/client/index.js +1 -0
  7. package/dist/client/index.mjs +476 -0
  8. package/dist/client/provider.d.ts +25 -0
  9. package/dist/client/server-actions-helper.d.ts +22 -0
  10. package/dist/components/AccountPicker.d.ts +11 -0
  11. package/dist/components/OAuthButton.d.ts +11 -0
  12. package/dist/components/PassKeyButton.d.ts +11 -0
  13. package/dist/components/PassKeyRegister.d.ts +10 -0
  14. package/dist/components/TwoFactorSetup.d.ts +8 -0
  15. package/dist/components/TwoFactorVerify.d.ts +9 -0
  16. package/dist/core/account-picker/encryption.d.ts +22 -0
  17. package/dist/core/account-picker/index.d.ts +22 -0
  18. package/dist/core/auth/index.d.ts +40 -0
  19. package/dist/core/auth/oauth-providers.d.ts +69 -0
  20. package/dist/core/auth/oauth-state-store.d.ts +44 -0
  21. package/dist/core/auth/oauth.d.ts +20 -0
  22. package/dist/core/auth/passkey.d.ts +35 -0
  23. package/dist/core/auth/password.d.ts +22 -0
  24. package/dist/core/auth/signin-unified.d.ts +33 -0
  25. package/dist/core/auth/two-factor.d.ts +28 -0
  26. package/dist/core/client/index.d.ts +132 -0
  27. package/dist/core/client/token-refresh-manager.d.ts +48 -0
  28. package/dist/core/index.d.ts +10 -0
  29. package/dist/core/security/csrf.d.ts +46 -0
  30. package/dist/core/security/headers.d.ts +24 -0
  31. package/dist/core/security/index.d.ts +28 -0
  32. package/dist/core/security/rate-limit.d.ts +39 -0
  33. package/dist/core/security/validation.d.ts +53 -0
  34. package/dist/core/security/xss.d.ts +20 -0
  35. package/dist/core/session/index.d.ts +35 -0
  36. package/dist/core/types/auth.d.ts +131 -0
  37. package/dist/core/types/errors.d.ts +44 -0
  38. package/dist/core/types/index.d.ts +369 -0
  39. package/dist/core/utils/auth-helpers.d.ts +136 -0
  40. package/dist/core/utils/logger.d.ts +17 -0
  41. package/dist/handlers/api.d.ts +10 -0
  42. package/dist/handlers/route.d.ts +22 -0
  43. package/dist/index/index.js +1 -0
  44. package/dist/index/index.mjs +1633 -0
  45. package/dist/index.d.ts +21 -0
  46. package/dist/middleware/index.d.ts +28 -0
  47. package/dist/middleware/proxy.d.ts +53 -0
  48. package/dist/middleware/security.d.ts +9 -0
  49. package/dist/mulguard.d.ts +263 -0
  50. package/dist/oauth-state-CzIWQq3s.js +1 -0
  51. package/dist/oauth-state-LE-qeq-K.mjs +282 -0
  52. package/dist/server/actions.d.ts +86 -0
  53. package/dist/server/auth.d.ts +65 -0
  54. package/dist/server/cookies.d.ts +42 -0
  55. package/dist/server/helpers.d.ts +10 -0
  56. package/dist/server/index.d.ts +14 -0
  57. package/dist/server/index.js +1 -0
  58. package/dist/server/index.mjs +31 -0
  59. package/dist/server/middleware.d.ts +39 -0
  60. package/dist/server/oauth-state.d.ts +24 -0
  61. package/dist/server/session-helpers.d.ts +26 -0
  62. package/dist/server/session.d.ts +28 -0
  63. package/dist/server/utils.d.ts +10 -0
  64. package/dist/signin-unified-BS2gxaG1.mjs +30 -0
  65. package/dist/signin-unified-Cw41EFkc.js +1 -0
  66. package/package.json +73 -0
@@ -0,0 +1,86 @@
1
+ import { MulguardInstance } from '../mulguard';
2
+ import { Verify2FAData, AuthResult, EmailCredentials, RegisterData } from '../core/types';
3
+ /**
4
+ * Verify 2FA code - Server Action
5
+ *
6
+ * ✅ Works in all scenarios:
7
+ * - Direct import in client components
8
+ * - Wrapped in separate files with 'use server'
9
+ * - Automatic CSRF protection and cookie handling
10
+ *
11
+ * @example
12
+ * ```typescript
13
+ * // Option 1: Direct use in client component
14
+ * 'use client'
15
+ * import { verify2FAAction } from 'mulguard/server'
16
+ * import { auth } from '@/lib/auth'
17
+ *
18
+ * const result = await verify2FAAction(auth, { email, userId, code })
19
+ * ```
20
+ *
21
+ * @example
22
+ * ```typescript
23
+ * // Option 2: Wrap in separate file
24
+ * // lib/auth-actions.ts
25
+ * 'use server'
26
+ * import { verify2FAAction as baseVerify2FA } from 'mulguard/server'
27
+ * import { auth } from './auth'
28
+ *
29
+ * export async function verify2FA(data: Verify2FAData) {
30
+ * return await baseVerify2FA(auth, data)
31
+ * }
32
+ *
33
+ * // Then use in client component:
34
+ * 'use client'
35
+ * import { verify2FA } from '@/lib/auth-actions'
36
+ * const result = await verify2FA({ email, userId, code })
37
+ * ```
38
+ */
39
+ export declare function verify2FAAction(auth: MulguardInstance, data: Verify2FAData): Promise<AuthResult>;
40
+ /**
41
+ * Sign out - Server Action
42
+ *
43
+ * ✅ Works in all scenarios:
44
+ * - Direct import in client components
45
+ * - Wrapped in separate files with 'use server'
46
+ * - Automatic cookie clearing
47
+ *
48
+ * @example
49
+ * ```typescript
50
+ * // Option 1: Direct use in client component
51
+ * 'use client'
52
+ * import { signOutAction } from 'mulguard/server'
53
+ * import { auth } from '@/lib/auth'
54
+ *
55
+ * await signOutAction(auth)
56
+ * ```
57
+ *
58
+ * @example
59
+ * ```typescript
60
+ * // Option 2: Wrap in separate file
61
+ * // lib/auth-actions.ts
62
+ * 'use server'
63
+ * import { signOutAction as baseSignOut } from 'mulguard/server'
64
+ * import { auth } from './auth'
65
+ *
66
+ * export async function signOut() {
67
+ * return await baseSignOut(auth)
68
+ * }
69
+ * ```
70
+ */
71
+ export declare function signOutAction(auth: MulguardInstance): Promise<{
72
+ success: boolean;
73
+ error?: string;
74
+ }>;
75
+ /**
76
+ * Sign in with email - Server Action
77
+ *
78
+ * ✅ Works in all scenarios
79
+ */
80
+ export declare function signInEmailAction(auth: MulguardInstance, credentials: EmailCredentials): Promise<AuthResult>;
81
+ /**
82
+ * Sign up - Server Action
83
+ *
84
+ * ✅ Works in all scenarios
85
+ */
86
+ export declare function signUpAction(auth: MulguardInstance, data: RegisterData): Promise<AuthResult>;
@@ -0,0 +1,65 @@
1
+ import { Session, User } from '../core/types';
2
+ import { MulguardInstance } from '../mulguard';
3
+ /**
4
+ * Get server session using auth instance
5
+ *
6
+ * @example
7
+ * ```typescript
8
+ * import { auth } from '@/auth'
9
+ * import { getServerSession } from 'mulguard/server'
10
+ *
11
+ * export default async function Page() {
12
+ * const session = await getServerSession(auth)
13
+ * if (!session) {
14
+ * redirect('/login')
15
+ * }
16
+ * return <div>Hello {session.user.name}</div>
17
+ * }
18
+ * ```
19
+ */
20
+ export declare function getServerSession(auth: MulguardInstance): Promise<Session | null>;
21
+ /**
22
+ * Require authentication - redirects if not authenticated
23
+ *
24
+ * @example
25
+ * ```typescript
26
+ * import { auth } from '@/auth'
27
+ * import { requireAuth } from 'mulguard/server'
28
+ *
29
+ * export default async function ProtectedPage() {
30
+ * const session = await requireAuth(auth, '/login')
31
+ * return <div>Hello {session.user.name}</div>
32
+ * }
33
+ * ```
34
+ */
35
+ export declare function requireAuth(auth: MulguardInstance, redirectTo?: string): Promise<Session>;
36
+ /**
37
+ * Require specific role
38
+ *
39
+ * @example
40
+ * ```typescript
41
+ * import { auth } from '@/auth'
42
+ * import { requireRole } from 'mulguard/server'
43
+ *
44
+ * export default async function AdminPage() {
45
+ * const session = await requireRole(auth, 'admin', '/unauthorized')
46
+ * return <div>Admin Dashboard</div>
47
+ * }
48
+ * ```
49
+ */
50
+ export declare function requireRole(auth: MulguardInstance, role: string, redirectTo?: string): Promise<Session>;
51
+ /**
52
+ * Get current user
53
+ *
54
+ * @example
55
+ * ```typescript
56
+ * import { auth } from '@/auth'
57
+ * import { getCurrentUser } from 'mulguard/server'
58
+ *
59
+ * export default async function Page() {
60
+ * const user = await getCurrentUser(auth)
61
+ * return <div>{user ? `Hello ${user.name}` : 'Not logged in'}</div>
62
+ * }
63
+ * ```
64
+ */
65
+ export declare function getCurrentUser(auth: MulguardInstance): Promise<User | null>;
@@ -0,0 +1,42 @@
1
+ import { SessionConfig } from '../core/types';
2
+ export interface CookieOptions {
3
+ name: string;
4
+ value: string;
5
+ maxAge?: number;
6
+ expires?: Date;
7
+ httpOnly?: boolean;
8
+ secure?: boolean;
9
+ sameSite?: 'strict' | 'lax' | 'none';
10
+ path?: string;
11
+ domain?: string;
12
+ }
13
+ /**
14
+ * Get cookie value from Next.js cookies
15
+ */
16
+ export declare function getCookie(name: string): Promise<string | undefined>;
17
+ /**
18
+ * Result of setting a cookie
19
+ */
20
+ export interface SetCookieResult {
21
+ success: boolean;
22
+ error?: string;
23
+ warning?: string;
24
+ }
25
+ /**
26
+ * Set cookie in Next.js response
27
+ * Note: This requires using Next.js 15+ with async cookies() or response cookies
28
+ *
29
+ * @returns Result indicating success or failure with error message
30
+ */
31
+ export declare function setCookie(options: CookieOptions): Promise<SetCookieResult>;
32
+ /**
33
+ * Delete cookie
34
+ */
35
+ export declare function deleteCookie(name: string, options?: {
36
+ path?: string;
37
+ domain?: string;
38
+ }): Promise<void>;
39
+ /**
40
+ * Build cookie options from session config
41
+ */
42
+ export declare function buildCookieOptions(name: string, value: string, config: SessionConfig): CookieOptions;
@@ -0,0 +1,10 @@
1
+ import { MulguardInstance } from '../mulguard';
2
+ import { MulguardConfig } from '../core/types';
3
+ /**
4
+ * Create server-side auth helpers with pre-configured instance
5
+ */
6
+ export declare function createServerHelpers(_auth: MulguardInstance, _config: MulguardConfig): {
7
+ getSession: () => Promise<import('..').Session | null>;
8
+ requireAuth: (redirectTo?: string) => Promise<import('..').Session>;
9
+ requireRole: (role: string, redirectTo?: string) => Promise<import('..').Session>;
10
+ };
@@ -0,0 +1,14 @@
1
+ /**
2
+ * Server-side utilities for Next.js
3
+ */
4
+ export * from './cookies';
5
+ export * from './session';
6
+ export * from './auth';
7
+ export * from './helpers';
8
+ export * from './utils';
9
+ export { isSessionExpiringSoon, getSessionTimeUntilExpiry, isSessionValid, validateSessionStructure, isSessionExpiredNullable, } from './session-helpers';
10
+ export { createAuthMiddleware as createServerAuthMiddleware, requireAuthMiddleware as requireServerAuthMiddleware, requireRoleMiddleware as requireServerRoleMiddleware, } from './middleware';
11
+ export { getServerSession, requireAuth, requireRole, getCurrentUser } from './auth';
12
+ export { createServerUtils } from './utils';
13
+ export { verify2FAAction, signOutAction, signInEmailAction, signUpAction, } from './actions';
14
+ export { storeOAuthStateCookie, getOAuthStateCookie, deleteOAuthStateCookie, } from './oauth-state';
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("../actions-CExpv_dD.js"),e=require("../oauth-state-CzIWQq3s.js");exports.buildCookieOptions=i.buildCookieOptions;exports.deleteCookie=i.deleteCookie;exports.getCookie=i.getCookie;exports.setCookie=i.setCookie;exports.signInEmailAction=i.signInEmailAction;exports.signOutAction=i.signOutAction;exports.signUpAction=i.signUpAction;exports.verify2FAAction=i.verify2FAAction;exports.createServerAuthMiddleware=e.createAuthMiddleware;exports.createServerHelpers=e.createServerHelpers;exports.createServerUtils=e.createServerUtils;exports.createSessionManager=e.createSessionManager;exports.deleteOAuthStateCookie=e.deleteOAuthStateCookie;exports.getCurrentUser=e.getCurrentUser;exports.getOAuthStateCookie=e.getOAuthStateCookie;exports.getServerSession=e.getServerSession;exports.getSessionTimeUntilExpiry=e.getSessionTimeUntilExpiry;exports.isSessionExpiredNullable=e.isSessionExpiredNullable;exports.isSessionExpiringSoon=e.isSessionExpiringSoon;exports.isSessionValid=e.isSessionValid;exports.refreshSession=e.refreshSession;exports.requireAuth=e.requireAuth;exports.requireRole=e.requireRole;exports.requireServerAuthMiddleware=e.requireAuthMiddleware;exports.requireServerRoleMiddleware=e.requireRoleMiddleware;exports.storeOAuthStateCookie=e.storeOAuthStateCookie;exports.validateSessionStructure=e.validateSessionStructure;
@@ -0,0 +1,31 @@
1
+ import { e as a, d as i, g as r, c as t, a as o, s as n, b as S, v as l } from "../actions-DeCfLtHA.mjs";
2
+ import { c as d, p as g, k as c, n as A, m as v, j as p, l as h, e as k, g as C, b as f, i as m, a as x, o as O, f as b, h as q, r as E, d as M, s as U, v as w } from "../oauth-state-LE-qeq-K.mjs";
3
+ export {
4
+ a as buildCookieOptions,
5
+ d as createServerAuthMiddleware,
6
+ g as createServerHelpers,
7
+ c as createServerUtils,
8
+ A as createSessionManager,
9
+ i as deleteCookie,
10
+ v as deleteOAuthStateCookie,
11
+ r as getCookie,
12
+ p as getCurrentUser,
13
+ h as getOAuthStateCookie,
14
+ k as getServerSession,
15
+ C as getSessionTimeUntilExpiry,
16
+ f as isSessionExpiredNullable,
17
+ m as isSessionExpiringSoon,
18
+ x as isSessionValid,
19
+ O as refreshSession,
20
+ b as requireAuth,
21
+ q as requireRole,
22
+ E as requireServerAuthMiddleware,
23
+ M as requireServerRoleMiddleware,
24
+ t as setCookie,
25
+ o as signInEmailAction,
26
+ n as signOutAction,
27
+ S as signUpAction,
28
+ U as storeOAuthStateCookie,
29
+ w as validateSessionStructure,
30
+ l as verify2FAAction
31
+ };
@@ -0,0 +1,39 @@
1
+ import { NextRequest, NextResponse } from 'next/server';
2
+ import { MulguardInstance } from '../mulguard';
3
+ export interface AuthMiddlewareOptions {
4
+ /** Redirect to this URL if authentication is required but user is not authenticated */
5
+ redirectTo?: string;
6
+ /** Require authentication for all routes */
7
+ requireAuth?: boolean;
8
+ /** Require specific roles */
9
+ allowedRoles?: string[];
10
+ /** Public routes that don't require authentication */
11
+ publicRoutes?: string[];
12
+ }
13
+ /**
14
+ * Create authentication middleware for Next.js
15
+ *
16
+ * @example
17
+ * ```typescript
18
+ * // middleware.ts
19
+ * import { auth } from '@/lib/auth'
20
+ * import { createAuthMiddleware } from 'mulguard/server'
21
+ *
22
+ * export const middleware = createAuthMiddleware(auth, {
23
+ * requireAuth: true,
24
+ * redirectTo: '/auth/login',
25
+ * allowedRoles: ['admin'],
26
+ * })
27
+ * ```
28
+ */
29
+ export declare function createAuthMiddleware(auth: MulguardInstance, options?: AuthMiddlewareOptions): (request: NextRequest) => Promise<NextResponse | null>;
30
+ /**
31
+ * Require authentication middleware
32
+ * Shortcut for createAuthMiddleware with requireAuth: true
33
+ */
34
+ export declare function requireAuthMiddleware(auth: MulguardInstance, redirectTo?: string): (request: NextRequest) => Promise<NextResponse | null>;
35
+ /**
36
+ * Require role middleware
37
+ * Shortcut for createAuthMiddleware with allowedRoles
38
+ */
39
+ export declare function requireRoleMiddleware(auth: MulguardInstance, roles: string[], redirectTo?: string): (request: NextRequest) => Promise<NextResponse | null>;
@@ -0,0 +1,24 @@
1
+ /**
2
+ * Server-side OAuth state management
3
+ * Stores OAuth state in httpOnly cookies for security
4
+ */
5
+ /**
6
+ * Store OAuth state in httpOnly cookie
7
+ * ✅ SECURE: Uses httpOnly cookie to prevent XSS attacks
8
+ */
9
+ export declare function storeOAuthStateCookie(state: string, provider: string): Promise<{
10
+ success: boolean;
11
+ error?: string;
12
+ }>;
13
+ /**
14
+ * Get and validate OAuth state from cookie
15
+ * ✅ SECURE: Validates state and deletes after use (one-time use)
16
+ */
17
+ export declare function getOAuthStateCookie(): Promise<{
18
+ state: string;
19
+ provider: string;
20
+ } | null>;
21
+ /**
22
+ * Delete OAuth state cookie
23
+ */
24
+ export declare function deleteOAuthStateCookie(): Promise<void>;
@@ -0,0 +1,26 @@
1
+ import { Session } from '../core/types';
2
+ /**
3
+ * Check if session is expired (helper version that accepts null)
4
+ * Note: The main isSessionExpired is exported from session.ts
5
+ * This is a convenience helper for nullable sessions
6
+ */
7
+ export declare function isSessionExpiredNullable(session: Session | null): boolean;
8
+ /**
9
+ * Check if session is expiring soon
10
+ * @param session - Session to check
11
+ * @param thresholdMinutes - Minutes before expiration to consider "soon" (default: 5)
12
+ */
13
+ export declare function isSessionExpiringSoon(session: Session | null, thresholdMinutes?: number): boolean;
14
+ /**
15
+ * Get time until session expiration in minutes
16
+ */
17
+ export declare function getSessionTimeUntilExpiry(session: Session | null): number | null;
18
+ /**
19
+ * Check if session is valid (not expired and has required fields)
20
+ */
21
+ export declare function isSessionValid(session: Session | null): session is Session;
22
+ /**
23
+ * Validate session structure
24
+ * Centralized validation logic used across the library
25
+ */
26
+ export declare function validateSessionStructure(session: unknown): session is Session;
@@ -0,0 +1,28 @@
1
+ import { Session, SessionConfig } from '../core/types';
2
+ type ApiClient = {
3
+ get: <T>(url: string) => Promise<{
4
+ data: T;
5
+ }>;
6
+ post: <T>(url: string, data?: unknown) => Promise<{
7
+ data: T;
8
+ }>;
9
+ };
10
+ export interface SessionManager {
11
+ getSession(options?: {
12
+ skipRefresh?: boolean;
13
+ }): Promise<Session | null>;
14
+ setSession(session: Session, config: SessionConfig): void;
15
+ clearSession(config: SessionConfig): Promise<void>;
16
+ refreshSession(): Promise<Session | null>;
17
+ isSessionExpired(session: Session): boolean;
18
+ shouldRefreshSession(session: Session, config: SessionConfig): boolean;
19
+ }
20
+ /**
21
+ * Create session manager with automatic refresh
22
+ */
23
+ export declare function createSessionManager(client: ApiClient, config: SessionConfig): SessionManager;
24
+ /**
25
+ * Refresh session
26
+ */
27
+ export declare function refreshSession(client: ApiClient, _config: SessionConfig): Promise<Session | null>;
28
+ export {};
@@ -0,0 +1,10 @@
1
+ import { MulguardInstance } from '../mulguard';
2
+ /**
3
+ * Create server-side helpers with pre-configured auth instance
4
+ */
5
+ export declare function createServerUtils(auth: MulguardInstance): {
6
+ getSession: () => Promise<import('..').Session | null>;
7
+ requireAuth: (redirectTo?: string) => Promise<import('..').Session>;
8
+ requireRole: (role: string, redirectTo?: string) => Promise<import('..').Session>;
9
+ getCurrentUser: () => Promise<import('..').User | null>;
10
+ };
@@ -0,0 +1,30 @@
1
+ async function e(o, n, i) {
2
+ if (n === "google" || n === "github" || n === "apple" || n === "facebook" || typeof n == "string" && !["credentials", "otp", "passkey"].includes(n)) {
3
+ if (!o.signIn.oauth)
4
+ throw new Error("OAuth sign in is not configured. Provide oauth action in signIn.");
5
+ return o.signIn.oauth(n);
6
+ }
7
+ if (n === "credentials") {
8
+ if (!i || !("email" in i) || !("password" in i))
9
+ throw new Error("Credentials are required for credentials provider");
10
+ return o.signIn.email(i);
11
+ }
12
+ if (n === "otp") {
13
+ if (!i || !("email" in i))
14
+ throw new Error("Email is required for OTP provider");
15
+ const s = i;
16
+ if (!o.signIn.otp)
17
+ throw new Error("OTP sign in is not configured. Provide otp action in signIn.");
18
+ return o.signIn.otp(s.email, s.code);
19
+ }
20
+ if (n === "passkey") {
21
+ const s = i;
22
+ if (!o.signIn.passkey)
23
+ throw new Error("PassKey sign in is not configured. Provide passkey action in signIn.");
24
+ return o.signIn.passkey(s);
25
+ }
26
+ throw new Error(`Unknown provider: ${n}`);
27
+ }
28
+ export {
29
+ e as s
30
+ };
@@ -0,0 +1 @@
1
+ "use strict";async function e(o,n,i){if(n==="google"||n==="github"||n==="apple"||n==="facebook"||typeof n=="string"&&!["credentials","otp","passkey"].includes(n)){if(!o.signIn.oauth)throw new Error("OAuth sign in is not configured. Provide oauth action in signIn.");return o.signIn.oauth(n)}if(n==="credentials"){if(!i||!("email"in i)||!("password"in i))throw new Error("Credentials are required for credentials provider");return o.signIn.email(i)}if(n==="otp"){if(!i||!("email"in i))throw new Error("Email is required for OTP provider");const s=i;if(!o.signIn.otp)throw new Error("OTP sign in is not configured. Provide otp action in signIn.");return o.signIn.otp(s.email,s.code)}if(n==="passkey"){const s=i;if(!o.signIn.passkey)throw new Error("PassKey sign in is not configured. Provide passkey action in signIn.");return o.signIn.passkey(s)}throw new Error(`Unknown provider: ${n}`)}exports.signIn=e;
package/package.json ADDED
@@ -0,0 +1,73 @@
1
+ {
2
+ "name": "mulguard",
3
+ "version": "1.0.1",
4
+ "description": "Mulguard is a modern authentication backend-first library for Next.js",
5
+ "main": "./dist/index/index.js",
6
+ "module": "./dist/index/index.mjs",
7
+ "types": "./dist/index.d.ts",
8
+ "exports": {
9
+ ".": {
10
+ "types": "./dist/index.d.ts",
11
+ "import": "./dist/index/index.mjs",
12
+ "require": "./dist/index/index.js"
13
+ },
14
+ "./server": {
15
+ "types": "./dist/server/index.d.ts",
16
+ "import": "./dist/server/index.mjs",
17
+ "require": "./dist/server/index.js"
18
+ },
19
+ "./client": {
20
+ "types": "./dist/client/index.d.ts",
21
+ "import": "./dist/client/index.mjs",
22
+ "require": "./dist/client/index.js"
23
+ }
24
+ },
25
+ "files": [
26
+ "dist"
27
+ ],
28
+ "scripts": {
29
+ "build": "vite build",
30
+ "dev": "vite build --watch",
31
+ "test": "vitest",
32
+ "test:watch": "vitest --watch",
33
+ "test:coverage": "vitest --coverage",
34
+ "type-check": "tsc --noEmit",
35
+ "clean": "node -e \"require('fs').rmSync('dist', {recursive: true, force: true})\"",
36
+ "prepublishOnly": "npm run build",
37
+ "changeset": "changeset add",
38
+ "version": "changeset version",
39
+ "release": "changeset version && npm run build && changeset publish"
40
+ },
41
+ "keywords": [
42
+ "nextjs",
43
+ "mulguard",
44
+ "mulink",
45
+ "mukey",
46
+ "mulverse",
47
+ "MxHabob",
48
+ "authentication",
49
+ "auth",
50
+ "next-auth"
51
+ ],
52
+ "author": "Mulguard Team",
53
+ "license": "MUV ",
54
+ "dependencies": {
55
+ "@noble/hashes": "^1.3.3"
56
+ },
57
+ "devDependencies": {
58
+ "@changesets/cli": "^2.27.1",
59
+ "@types/node": "^20.11.5",
60
+ "@types/react": "^18.2.48",
61
+ "next": "^16.0.10",
62
+ "turbo": "^2.0.0",
63
+ "typescript": "^5.3.3",
64
+ "vite": "^5.1.0",
65
+ "vite-plugin-dts": "^4.5.4",
66
+ "vitest": "^1.2.0"
67
+ },
68
+ "peerDependencies": {
69
+ "next": ">=14.0.0",
70
+ "react": ">=18.0.0 || ^19.0.0",
71
+ "react-dom": ">=18.0.0 || ^19.0.0"
72
+ }
73
+ }