@sveltebase/auth 1.0.0

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 (41) hide show
  1. package/README.md +395 -0
  2. package/dist/client/auth.svelte.d.ts +47 -0
  3. package/dist/client/auth.svelte.d.ts.map +1 -0
  4. package/dist/client/auth.svelte.js +130 -0
  5. package/dist/client/index.d.ts +2 -0
  6. package/dist/client/index.d.ts.map +1 -0
  7. package/dist/client/index.js +1 -0
  8. package/dist/google/GoogleLogin.svelte +83 -0
  9. package/dist/google/GoogleLogin.svelte.d.ts +22 -0
  10. package/dist/google/GoogleLogin.svelte.d.ts.map +1 -0
  11. package/dist/google/GoogleOAuthProvider.svelte +39 -0
  12. package/dist/google/GoogleOAuthProvider.svelte.d.ts +10 -0
  13. package/dist/google/GoogleOAuthProvider.svelte.d.ts.map +1 -0
  14. package/dist/google/GoogleOneTapLogin.svelte +52 -0
  15. package/dist/google/GoogleOneTapLogin.svelte.d.ts +14 -0
  16. package/dist/google/GoogleOneTapLogin.svelte.d.ts.map +1 -0
  17. package/dist/google/context.svelte.d.ts +11 -0
  18. package/dist/google/context.svelte.d.ts.map +1 -0
  19. package/dist/google/context.svelte.js +23 -0
  20. package/dist/google/google.svelte.d.ts +20 -0
  21. package/dist/google/google.svelte.d.ts.map +1 -0
  22. package/dist/google/google.svelte.js +109 -0
  23. package/dist/google/index.d.ts +9 -0
  24. package/dist/google/index.d.ts.map +1 -0
  25. package/dist/google/index.js +8 -0
  26. package/dist/google/loader.d.ts +2 -0
  27. package/dist/google/loader.d.ts.map +1 -0
  28. package/dist/google/loader.js +27 -0
  29. package/dist/google/types.d.ts +117 -0
  30. package/dist/google/types.d.ts.map +1 -0
  31. package/dist/google/types.js +1 -0
  32. package/dist/google/verifier.d.ts +17 -0
  33. package/dist/google/verifier.d.ts.map +1 -0
  34. package/dist/google/verifier.js +64 -0
  35. package/dist/index.d.ts +82 -0
  36. package/dist/index.d.ts.map +1 -0
  37. package/dist/index.js +194 -0
  38. package/dist/server/index.d.ts +28 -0
  39. package/dist/server/index.d.ts.map +1 -0
  40. package/dist/server/index.js +70 -0
  41. package/package.json +46 -0
@@ -0,0 +1,82 @@
1
+ import type { Cookies } from "@sveltejs/kit";
2
+ export type SessionUser<User> = User & {
3
+ token: string;
4
+ };
5
+ export interface AuthConfig {
6
+ /**
7
+ * Secret key used to sign and verify JWTs.
8
+ */
9
+ jwtSecret: string;
10
+ /**
11
+ * Name of the cookie storing the session token.
12
+ * @default "sf_session"
13
+ */
14
+ cookieName?: string;
15
+ /**
16
+ * Default cookie settings.
17
+ */
18
+ cookieOptions?: {
19
+ path?: string;
20
+ httpOnly?: boolean;
21
+ secure?: boolean;
22
+ sameSite?: "lax" | "strict" | "none";
23
+ domain?: string;
24
+ maxAge?: number;
25
+ };
26
+ }
27
+ export declare function base64urlEncode(uint8Array: Uint8Array): string;
28
+ export declare function base64urlDecode(str: string): Uint8Array;
29
+ /**
30
+ * Signs a payload into a JWT using HMAC-SHA256.
31
+ */
32
+ export declare function signJWT(payload: Record<string, any>, secret: string, expiresAt?: number): Promise<string>;
33
+ /**
34
+ * Verifies a JWT using HMAC-SHA256 and returns its payload.
35
+ */
36
+ export declare function verifyJWT(token: string, secret: string): Promise<Record<string, any>>;
37
+ /**
38
+ * Decodes the raw user session from cookies without verifying the JWT.
39
+ * Best used in layout load functions for super-fast, database-free SSR.
40
+ */
41
+ /**
42
+ * Decodes the raw user session from cookies without verifying the JWT.
43
+ * Best used in layout load functions for super-fast, database-free SSR.
44
+ */
45
+ export declare function getUserFromCookie<User>(cookies: Cookies, cookieName?: string): SessionUser<User> | null;
46
+ /**
47
+ * Parses a raw Cookie header string into key-value pairs.
48
+ */
49
+ export declare function parseCookies(cookieHeader: string): Record<string, string>;
50
+ /**
51
+ * Extracts and decodes the user session from standard Request headers without verifying it.
52
+ */
53
+ export declare function getUserFromRequest<User>(request: Request, cookieName?: string): SessionUser<User> | null;
54
+ /**
55
+ * Extracts and cryptographically verifies the user session from standard Request headers.
56
+ * Best used in write/mutation contexts.
57
+ */
58
+ export declare function getVerifiedUserFromRequest<User extends {
59
+ id: any;
60
+ }>(request: Request, jwtSecret: string, cookieName?: string): Promise<SessionUser<User> | null>;
61
+ /**
62
+ * Creates SvelteKit server-side session management helpers.
63
+ */
64
+ export declare function createServerAuth<User extends {
65
+ id: any;
66
+ }>(config: AuthConfig): {
67
+ /**
68
+ * Signs the user object into a JWT, embeds the token, and writes it to the SvelteKit cookies.
69
+ */
70
+ login(cookies: Cookies, userPayload: User, options?: {
71
+ maxAge?: number;
72
+ expires?: Date;
73
+ }): Promise<SessionUser<User>>;
74
+ /**
75
+ * Deletes the session cookie to clear the session.
76
+ */
77
+ logout(cookies: Cookies, options?: {
78
+ path?: string;
79
+ domain?: string;
80
+ }): void;
81
+ };
82
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAE7C,MAAM,MAAM,WAAW,CAAC,IAAI,IAAI,IAAI,GAAG;IAAE,KAAK,EAAE,MAAM,CAAA;CAAE,CAAC;AAEzD,MAAM,WAAW,UAAU;IACzB;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;IAClB;;;OAGG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;OAEG;IACH,aAAa,CAAC,EAAE;QACd,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,QAAQ,CAAC,EAAE,OAAO,CAAC;QACnB,MAAM,CAAC,EAAE,OAAO,CAAC;QACjB,QAAQ,CAAC,EAAE,KAAK,GAAG,QAAQ,GAAG,MAAM,CAAC;QACrC,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,MAAM,CAAC,EAAE,MAAM,CAAC;KACjB,CAAC;CACH;AAGD,wBAAgB,eAAe,CAAC,UAAU,EAAE,UAAU,GAAG,MAAM,CAQ9D;AAGD,wBAAgB,eAAe,CAAC,GAAG,EAAE,MAAM,GAAG,UAAU,CAWvD;AAuBD;;GAEG;AACH,wBAAsB,OAAO,CAAC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAgB/G;AAED;;GAEG;AACH,wBAAsB,SAAS,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC,CAsB3F;AAED;;;GAGG;AACH;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EACpC,OAAO,EAAE,OAAO,EAChB,UAAU,SAAe,GACxB,WAAW,CAAC,IAAI,CAAC,GAAG,IAAI,CAU1B;AAED;;GAEG;AACH,wBAAgB,YAAY,CAAC,YAAY,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAUzE;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EACrC,OAAO,EAAE,OAAO,EAChB,UAAU,SAAe,GACxB,WAAW,CAAC,IAAI,CAAC,GAAG,IAAI,CAc1B;AAED;;;GAGG;AACH,wBAAsB,0BAA0B,CAAC,IAAI,SAAS;IAAE,EAAE,EAAE,GAAG,CAAA;CAAE,EACvE,OAAO,EAAE,OAAO,EAChB,SAAS,EAAE,MAAM,EACjB,UAAU,SAAe,GACxB,OAAO,CAAC,WAAW,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC,CAUnC;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,SAAS;IAAE,EAAE,EAAE,GAAG,CAAA;CAAE,EAAE,MAAM,EAAE,UAAU;IAWzE;;OAEG;mBAEQ,OAAO,eACH,IAAI,YACP;QAAE,MAAM,CAAC,EAAE,MAAM,CAAC;QAAC,OAAO,CAAC,EAAE,IAAI,CAAA;KAAE,GAC5C,OAAO,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;IA2B7B;;OAEG;oBACa,OAAO,YAAY;QAAE,IAAI,CAAC,EAAE,MAAM,CAAC;QAAC,MAAM,CAAC,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI;EAO/E"}
package/dist/index.js ADDED
@@ -0,0 +1,194 @@
1
+ // Helper: Safe Base64URL encoding (Works in Edge / Node / Cloudflare Workers)
2
+ export function base64urlEncode(uint8Array) {
3
+ let binary = "";
4
+ const len = uint8Array.byteLength;
5
+ for (let i = 0; i < len; i++) {
6
+ binary += String.fromCharCode(uint8Array[i]);
7
+ }
8
+ const base64 = btoa(binary);
9
+ return base64.replace(/\+/g, "-").replace(/\//g, "_").replace(/=+$/, "");
10
+ }
11
+ // Helper: Safe Base64URL decoding (Works in Edge / Node / Cloudflare Workers)
12
+ export function base64urlDecode(str) {
13
+ let base64 = str.replace(/-/g, "+").replace(/_/g, "/");
14
+ while (base64.length % 4) {
15
+ base64 += "=";
16
+ }
17
+ const binary = atob(base64);
18
+ const bytes = new Uint8Array(binary.length);
19
+ for (let i = 0; i < binary.length; i++) {
20
+ bytes[i] = binary.charCodeAt(i);
21
+ }
22
+ return bytes;
23
+ }
24
+ function stringToBase64url(str) {
25
+ return base64urlEncode(new TextEncoder().encode(str));
26
+ }
27
+ function base64urlToString(str) {
28
+ return new TextDecoder().decode(base64urlDecode(str));
29
+ }
30
+ // Import CryptoKey helper using Web Crypto API
31
+ async function getCryptoKey(secret) {
32
+ const encoder = new TextEncoder();
33
+ const keyData = encoder.encode(secret);
34
+ return await crypto.subtle.importKey("raw", keyData, { name: "HMAC", hash: "SHA-256" }, false, ["sign", "verify"]);
35
+ }
36
+ /**
37
+ * Signs a payload into a JWT using HMAC-SHA256.
38
+ */
39
+ export async function signJWT(payload, secret, expiresAt) {
40
+ const header = { alg: "HS256", typ: "JWT" };
41
+ const fullPayload = {
42
+ ...payload,
43
+ ...(expiresAt ? { exp: Math.floor(expiresAt / 1000) } : {})
44
+ };
45
+ const headerStr = stringToBase64url(JSON.stringify(header));
46
+ const payloadStr = stringToBase64url(JSON.stringify(fullPayload));
47
+ const dataToSign = new TextEncoder().encode(`${headerStr}.${payloadStr}`);
48
+ const key = await getCryptoKey(secret);
49
+ const signatureBuffer = await crypto.subtle.sign("HMAC", key, dataToSign);
50
+ const signatureStr = base64urlEncode(new Uint8Array(signatureBuffer));
51
+ return `${headerStr}.${payloadStr}.${signatureStr}`;
52
+ }
53
+ /**
54
+ * Verifies a JWT using HMAC-SHA256 and returns its payload.
55
+ */
56
+ export async function verifyJWT(token, secret) {
57
+ const parts = token.split(".");
58
+ if (parts.length !== 3) {
59
+ throw new Error("Invalid token format");
60
+ }
61
+ const [headerStr, payloadStr, signatureStr] = parts;
62
+ const dataToVerify = new TextEncoder().encode(`${headerStr}.${payloadStr}`);
63
+ const signatureBytes = base64urlDecode(signatureStr);
64
+ const key = await getCryptoKey(secret);
65
+ const isValid = await crypto.subtle.verify("HMAC", key, signatureBytes, dataToVerify);
66
+ if (!isValid) {
67
+ throw new Error("Invalid signature");
68
+ }
69
+ const payload = JSON.parse(base64urlToString(payloadStr));
70
+ if (payload.exp && Date.now() >= payload.exp * 1000) {
71
+ throw new Error("Token expired");
72
+ }
73
+ return payload;
74
+ }
75
+ /**
76
+ * Decodes the raw user session from cookies without verifying the JWT.
77
+ * Best used in layout load functions for super-fast, database-free SSR.
78
+ */
79
+ /**
80
+ * Decodes the raw user session from cookies without verifying the JWT.
81
+ * Best used in layout load functions for super-fast, database-free SSR.
82
+ */
83
+ export function getUserFromCookie(cookies, cookieName = "sf_session") {
84
+ const cookieVal = cookies.get(cookieName);
85
+ if (!cookieVal)
86
+ return null;
87
+ try {
88
+ const jsonStr = atob(cookieVal);
89
+ return JSON.parse(jsonStr);
90
+ }
91
+ catch {
92
+ return null;
93
+ }
94
+ }
95
+ /**
96
+ * Parses a raw Cookie header string into key-value pairs.
97
+ */
98
+ export function parseCookies(cookieHeader) {
99
+ const cookies = {};
100
+ cookieHeader.split(";").forEach((cookie) => {
101
+ const parts = cookie.split("=");
102
+ const name = parts.shift()?.trim();
103
+ if (name) {
104
+ cookies[name] = decodeURIComponent(parts.join("="));
105
+ }
106
+ });
107
+ return cookies;
108
+ }
109
+ /**
110
+ * Extracts and decodes the user session from standard Request headers without verifying it.
111
+ */
112
+ export function getUserFromRequest(request, cookieName = "sf_session") {
113
+ const cookieHeader = request.headers.get("Cookie");
114
+ if (!cookieHeader)
115
+ return null;
116
+ const cookies = parseCookies(cookieHeader);
117
+ const rawSession = cookies[cookieName];
118
+ if (!rawSession)
119
+ return null;
120
+ try {
121
+ const jsonStr = atob(rawSession);
122
+ return JSON.parse(jsonStr);
123
+ }
124
+ catch {
125
+ return null;
126
+ }
127
+ }
128
+ /**
129
+ * Extracts and cryptographically verifies the user session from standard Request headers.
130
+ * Best used in write/mutation contexts.
131
+ */
132
+ export async function getVerifiedUserFromRequest(request, jwtSecret, cookieName = "sf_session") {
133
+ const user = getUserFromRequest(request, cookieName);
134
+ if (!user)
135
+ return null;
136
+ try {
137
+ await verifyJWT(user.token, jwtSecret);
138
+ return user;
139
+ }
140
+ catch {
141
+ return null;
142
+ }
143
+ }
144
+ /**
145
+ * Creates SvelteKit server-side session management helpers.
146
+ */
147
+ export function createServerAuth(config) {
148
+ const cookieName = config.cookieName || "sf_session";
149
+ const defaultCookieOptions = {
150
+ path: "/",
151
+ httpOnly: true,
152
+ secure: true,
153
+ sameSite: "lax",
154
+ ...config.cookieOptions,
155
+ };
156
+ return {
157
+ /**
158
+ * Signs the user object into a JWT, embeds the token, and writes it to the SvelteKit cookies.
159
+ */
160
+ async login(cookies, userPayload, options) {
161
+ let expiresAt;
162
+ if (options?.maxAge) {
163
+ expiresAt = Date.now() + options.maxAge * 1000;
164
+ }
165
+ else if (options?.expires) {
166
+ expiresAt = options.expires.getTime();
167
+ }
168
+ else if (defaultCookieOptions.maxAge) {
169
+ expiresAt = Date.now() + defaultCookieOptions.maxAge * 1000;
170
+ }
171
+ // Generate the verified JWT token using user id
172
+ const token = await signJWT({ id: userPayload.id }, config.jwtSecret, expiresAt);
173
+ const sessionUser = {
174
+ ...userPayload,
175
+ token,
176
+ };
177
+ const cookieVal = btoa(JSON.stringify(sessionUser));
178
+ cookies.set(cookieName, cookieVal, {
179
+ ...defaultCookieOptions,
180
+ ...options,
181
+ });
182
+ return sessionUser;
183
+ },
184
+ /**
185
+ * Deletes the session cookie to clear the session.
186
+ */
187
+ logout(cookies, options) {
188
+ cookies.delete(cookieName, {
189
+ path: "/",
190
+ ...options,
191
+ });
192
+ }
193
+ };
194
+ }
@@ -0,0 +1,28 @@
1
+ import { type SyncContext } from "@sveltebase/sync";
2
+ export interface SyncAuthConfig<User = any> {
3
+ /**
4
+ * Secret key used to verify the JWT tokens.
5
+ */
6
+ jwtSecret: string;
7
+ /**
8
+ * Name of the session cookie.
9
+ * @default "sf_session"
10
+ */
11
+ cookieName?: string;
12
+ /**
13
+ * Optional database hook to verify if the user still exists or is active.
14
+ */
15
+ verifyUser?: (user: User, ctx: SyncContext) => Promise<boolean>;
16
+ /**
17
+ * Optional database hook to persist user mutations.
18
+ */
19
+ onUpdate?: (userId: User extends {
20
+ id: infer Id;
21
+ } ? Id : string, changes: Partial<User>, ctx: SyncContext) => Promise<User>;
22
+ }
23
+ /**
24
+ * Creates a Svelteflare Sync handler for WebSocket-based session validation.
25
+ * Registers the read-only "users" channel.
26
+ */
27
+ export declare function createAuthSync<User = any>(config: SyncAuthConfig<User>): import("@sveltebase/sync").SyncHandler<User>;
28
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/server/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAc,KAAK,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAGhE,MAAM,WAAW,cAAc,CAAC,IAAI,GAAG,GAAG;IACxC;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;IAClB;;;OAGG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;OAEG;IACH,UAAU,CAAC,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,GAAG,EAAE,WAAW,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC;IAChE;;OAEG;IACH,QAAQ,CAAC,EAAE,CACT,MAAM,EAAE,IAAI,SAAS;QAAE,EAAE,EAAE,MAAM,EAAE,CAAA;KAAE,GAAG,EAAE,GAAG,MAAM,EACnD,OAAO,EAAE,OAAO,CAAC,IAAI,CAAC,EACtB,GAAG,EAAE,WAAW,KACb,OAAO,CAAC,IAAI,CAAC,CAAC;CACpB;AAED;;;GAGG;AACH,wBAAgB,cAAc,CAAC,IAAI,GAAG,GAAG,EAAE,MAAM,EAAE,cAAc,CAAC,IAAI,CAAC,gDA0EtE"}
@@ -0,0 +1,70 @@
1
+ import { defineSync } from "@sveltebase/sync";
2
+ import { getUserFromRequest, verifyJWT, getVerifiedUserFromRequest } from "../index.js";
3
+ /**
4
+ * Creates a Svelteflare Sync handler for WebSocket-based session validation.
5
+ * Registers the read-only "users" channel.
6
+ */
7
+ export function createAuthSync(config) {
8
+ const cookieName = config.cookieName || "sf_session";
9
+ return defineSync({
10
+ channel: "users",
11
+ // Runs automatically when the client queries/subscribes to the "users" channel
12
+ authorize: async (ctx) => {
13
+ const user = getUserFromRequest(ctx.request, cookieName);
14
+ if (!user) {
15
+ throw new Error("Unauthorized: No session cookie found");
16
+ }
17
+ // 1. Cryptographically verify the token
18
+ let payload;
19
+ try {
20
+ payload = await verifyJWT(user.token, config.jwtSecret);
21
+ }
22
+ catch {
23
+ throw new Error("Unauthorized: Invalid token");
24
+ }
25
+ // 2. Perform optional database validation (check if active/deleted)
26
+ if (config.verifyUser) {
27
+ const isValid = await config.verifyUser(payload, ctx);
28
+ if (!isValid) {
29
+ throw new Error("Unauthorized: User no longer exists");
30
+ }
31
+ }
32
+ },
33
+ // Returns the current session user so the client knows it is successfully authorized
34
+ fetch: async (ctx) => {
35
+ const user = getUserFromRequest(ctx.request, cookieName);
36
+ return user ? [user] : [];
37
+ },
38
+ create: async () => {
39
+ throw new Error("Forbidden: User creation is disabled on sync channel");
40
+ },
41
+ update: async (ctx, key, changes) => {
42
+ // Verify token authenticity before allowing writes
43
+ const user = await getVerifiedUserFromRequest(ctx.request, config.jwtSecret, cookieName);
44
+ if (!user) {
45
+ throw new Error("Unauthorized: Invalid session");
46
+ }
47
+ // Prevent users from updating other users' records (comparing string representations to support both string and number IDs)
48
+ if (String(user.id) !== String(key)) {
49
+ throw new Error("Forbidden: Cannot modify other user profiles");
50
+ }
51
+ // Persist update via dev's DB hook if registered
52
+ if (config.onUpdate) {
53
+ const typedKey = (typeof user.id === "number" ? Number(key) : key);
54
+ const dbResult = await config.onUpdate(typedKey, changes, ctx);
55
+ return {
56
+ ...dbResult,
57
+ token: user.token
58
+ };
59
+ }
60
+ // Fallback: return merged changes
61
+ return { ...user, ...changes };
62
+ },
63
+ delete: async () => {
64
+ throw new Error("Forbidden: User deletion is disabled on sync channel");
65
+ },
66
+ scope: (ctx, action, data) => {
67
+ return [String(data.id)];
68
+ }
69
+ });
70
+ }
package/package.json ADDED
@@ -0,0 +1,46 @@
1
+ {
2
+ "name": "@sveltebase/auth",
3
+ "version": "1.0.0",
4
+ "type": "module",
5
+ "publishConfig": {
6
+ "access": "public"
7
+ },
8
+ "files": [
9
+ "dist"
10
+ ],
11
+ "svelte": "./dist/index.js",
12
+ "types": "./dist/index.d.ts",
13
+ "exports": {
14
+ ".": {
15
+ "types": "./dist/index.d.ts",
16
+ "svelte": "./dist/index.js",
17
+ "default": "./dist/index.js"
18
+ },
19
+ "./client": {
20
+ "types": "./dist/client/index.d.ts",
21
+ "svelte": "./dist/client/index.js",
22
+ "default": "./dist/client/index.js"
23
+ },
24
+ "./server": {
25
+ "types": "./dist/server/index.d.ts",
26
+ "default": "./dist/server/index.js"
27
+ },
28
+ "./google": {
29
+ "types": "./dist/google/index.d.ts",
30
+ "svelte": "./dist/google/index.js",
31
+ "default": "./dist/google/index.js"
32
+ }
33
+ },
34
+ "peerDependencies": {
35
+ "svelte": "^5.0.0",
36
+ "@sveltejs/kit": "^2.0.0"
37
+ },
38
+ "devDependencies": {
39
+ "@types/google.accounts": "^0.0.14"
40
+ },
41
+ "scripts": {
42
+ "build": "svelte-package --input ./src --output ./dist",
43
+ "check": "tsc --project tsconfig.json --noEmit",
44
+ "clean": "rm -rf dist"
45
+ }
46
+ }