@proveanything/smartlinks 1.0.47 → 1.0.49

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/API_SUMMARY.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Smartlinks API Summary
2
2
 
3
- Version: 1.0.47 | Generated: 2025-11-23T09:18:23.853Z
3
+ Version: 1.0.49 | Generated: 2025-11-23T11:46:58.029Z
4
4
 
5
5
  This is a concise summary of all available API functions and types.
6
6
 
@@ -164,9 +164,18 @@ interface AuthKitUser {
164
164
  **AuthLoginResponse** (interface)
165
165
  ```typescript
166
166
  interface AuthLoginResponse {
167
- token: string
167
+ token?: string
168
168
  user: AuthKitUser
169
169
  accountData?: Record<string, any>
170
+ emailVerificationMode?: 'immediate' | 'verify-auto-login' | 'verify-manual-login'
171
+ }
172
+ ```
173
+
174
+ **MagicLinkSendResponse** (interface)
175
+ ```typescript
176
+ interface MagicLinkSendResponse {
177
+ success: boolean
178
+ message: string
170
179
  }
171
180
  ```
172
181
 
@@ -778,10 +787,16 @@ Register a new user (public).
778
787
  **googleLogin**(clientId: string, idToken: string) → `Promise<AuthLoginResponse>`
779
788
  Google OAuth login (public).
780
789
 
790
+ **sendMagicLink**(clientId: string, data: { email: string; redirectUrl: string; accountData?: Record<string, any> }) → `Promise<MagicLinkSendResponse>`
791
+ Send a magic link email to the user (public).
792
+
793
+ **verifyMagicLink**(clientId: string, token: string) → `Promise<MagicLinkVerifyResponse>`
794
+ Verify a magic link token and authenticate/create the user (public).
795
+
781
796
  **sendPhoneCode**(clientId: string, phoneNumber: string) → `Promise<PhoneSendCodeResponse>`
782
797
  Send phone verification code (public).
783
798
 
784
- **verifyPhoneCode**(clientId: string, verificationId: string, code: string) → `Promise<PhoneVerifyResponse>`
799
+ **verifyPhoneCode**(clientId: string, phoneNumber: string, code: string) → `Promise<PhoneVerifyResponse>`
785
800
  Verify phone verification code (public).
786
801
 
787
802
  **requestPasswordReset**(clientId: string, data: { email: string; redirectUrl?: string; clientName?: string }) → `Promise<PasswordResetRequestResponse>`
@@ -1,4 +1,4 @@
1
- import type { AuthLoginResponse, PhoneSendCodeResponse, PhoneVerifyResponse, PasswordResetRequestResponse, VerifyResetTokenResponse, PasswordResetCompleteResponse, EmailVerificationActionResponse, EmailVerifyTokenResponse, AuthKitConfig } from "../types/authKit";
1
+ import type { AuthLoginResponse, PhoneSendCodeResponse, PhoneVerifyResponse, PasswordResetRequestResponse, VerifyResetTokenResponse, PasswordResetCompleteResponse, EmailVerificationActionResponse, EmailVerifyTokenResponse, AuthKitConfig, MagicLinkSendResponse, MagicLinkVerifyResponse } from "../types/authKit";
2
2
  /**
3
3
  * Namespace containing helper functions for the new AuthKit API.
4
4
  * Legacy collection-based authKit helpers retained (marked as *Legacy*).
@@ -15,10 +15,18 @@ export declare namespace authKit {
15
15
  }): Promise<AuthLoginResponse>;
16
16
  /** Google OAuth login (public). */
17
17
  function googleLogin(clientId: string, idToken: string): Promise<AuthLoginResponse>;
18
+ /** Send a magic link email to the user (public). */
19
+ function sendMagicLink(clientId: string, data: {
20
+ email: string;
21
+ redirectUrl: string;
22
+ accountData?: Record<string, any>;
23
+ }): Promise<MagicLinkSendResponse>;
24
+ /** Verify a magic link token and authenticate/create the user (public). */
25
+ function verifyMagicLink(clientId: string, token: string): Promise<MagicLinkVerifyResponse>;
18
26
  /** Send phone verification code (public). */
19
27
  function sendPhoneCode(clientId: string, phoneNumber: string): Promise<PhoneSendCodeResponse>;
20
28
  /** Verify phone verification code (public). */
21
- function verifyPhoneCode(clientId: string, verificationId: string, code: string): Promise<PhoneVerifyResponse>;
29
+ function verifyPhoneCode(clientId: string, phoneNumber: string, code: string): Promise<PhoneVerifyResponse>;
22
30
  function requestPasswordReset(clientId: string, data: {
23
31
  email: string;
24
32
  redirectUrl?: string;
@@ -1,4 +1,4 @@
1
- import { request, post, put, del } from "../http";
1
+ import { request, post, put, del, setBearerToken } from "../http";
2
2
  /**
3
3
  * Namespace containing helper functions for the new AuthKit API.
4
4
  * Legacy collection-based authKit helpers retained (marked as *Legacy*).
@@ -23,14 +23,27 @@ export var authKit;
23
23
  return post(`/authkit/${encodeURIComponent(clientId)}/auth/google`, { idToken });
24
24
  }
25
25
  authKit.googleLogin = googleLogin;
26
+ /** Send a magic link email to the user (public). */
27
+ async function sendMagicLink(clientId, data) {
28
+ return post(`/authkit/${encodeURIComponent(clientId)}/magic-link/send`, data);
29
+ }
30
+ authKit.sendMagicLink = sendMagicLink;
31
+ /** Verify a magic link token and authenticate/create the user (public). */
32
+ async function verifyMagicLink(clientId, token) {
33
+ const res = await post(`/authkit/${encodeURIComponent(clientId)}/magic-link/verify`, { token });
34
+ if (res.token)
35
+ setBearerToken(res.token);
36
+ return res;
37
+ }
38
+ authKit.verifyMagicLink = verifyMagicLink;
26
39
  /** Send phone verification code (public). */
27
40
  async function sendPhoneCode(clientId, phoneNumber) {
28
41
  return post(`/authkit/${encodeURIComponent(clientId)}/auth/phone/send-code`, { phoneNumber });
29
42
  }
30
43
  authKit.sendPhoneCode = sendPhoneCode;
31
44
  /** Verify phone verification code (public). */
32
- async function verifyPhoneCode(clientId, verificationId, code) {
33
- return post(`/authkit/${encodeURIComponent(clientId)}/auth/phone/verify`, { verificationId, code });
45
+ async function verifyPhoneCode(clientId, phoneNumber, code) {
46
+ return post(`/authkit/${encodeURIComponent(clientId)}/auth/phone/verify`, { phoneNumber, code });
34
47
  }
35
48
  authKit.verifyPhoneCode = verifyPhoneCode;
36
49
  /* ===================================
@@ -67,7 +80,7 @@ export var authKit;
67
80
  * Collection-based AuthKit
68
81
  * =================================== */
69
82
  async function load(authKitId) {
70
- const path = `/authKit/${encodeURIComponent(authKitId)}`;
83
+ const path = `/authKit/${encodeURIComponent(authKitId)}/config`;
71
84
  return request(path);
72
85
  }
73
86
  authKit.load = load;
@@ -8,9 +8,16 @@ export interface AuthKitUser {
8
8
  accountData?: Record<string, any>;
9
9
  }
10
10
  export interface AuthLoginResponse {
11
- token: string;
11
+ token?: string;
12
12
  user: AuthKitUser;
13
13
  accountData?: Record<string, any>;
14
+ emailVerificationMode?: 'immediate' | 'verify-auto-login' | 'verify-manual-login';
15
+ }
16
+ export interface MagicLinkSendResponse {
17
+ success: boolean;
18
+ message: string;
19
+ }
20
+ export interface MagicLinkVerifyResponse extends AuthLoginResponse {
14
21
  }
15
22
  export interface PhoneSendCodeResponse {
16
23
  verificationId: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@proveanything/smartlinks",
3
- "version": "1.0.47",
3
+ "version": "1.0.49",
4
4
  "description": "Official JavaScript/TypeScript SDK for the Smartlinks API",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",