@proveanything/smartlinks 1.0.42 → 1.0.43

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.42 | Generated: 2025-11-18T13:09:06.423Z
3
+ Version: 1.0.43 | Generated: 2025-11-22T12:58:28.713Z
4
4
 
5
5
  This is a concise summary of all available API functions and types.
6
6
 
@@ -14,6 +14,7 @@ The Smartlinks SDK is organized into the following namespaces:
14
14
  - **asset** - File upload and asset management for collections, products, and proofs
15
15
  - **attestation** - Digital attestations and verification for products
16
16
  - **auth** - Authentication, login, and user account management
17
+ - **authKit** - Functions for authKit operations
17
18
  - **batch** - Product batch management and tracking
18
19
  - **claimSet** - Claim creation, management, and verification
19
20
  - **collection** - Collection CRUD operations and management
@@ -137,6 +138,119 @@ type UserAccountRegistrationRequest = {
137
138
  }
138
139
  ```
139
140
 
141
+ ### authKit
142
+
143
+ **AuthKitUser** (interface)
144
+ ```typescript
145
+ interface AuthKitUser {
146
+ uid: string
147
+ email?: string
148
+ displayName?: string | null
149
+ photoURL?: string | null
150
+ phoneNumber?: string | null
151
+ emailVerified?: boolean
152
+ accountData?: Record<string, any>
153
+ }
154
+ ```
155
+
156
+ **AuthLoginResponse** (interface)
157
+ ```typescript
158
+ interface AuthLoginResponse {
159
+ token: string
160
+ user: AuthKitUser
161
+ accountData?: Record<string, any>
162
+ }
163
+ ```
164
+
165
+ **PhoneSendCodeResponse** (interface)
166
+ ```typescript
167
+ interface PhoneSendCodeResponse {
168
+ verificationId: string
169
+ message: string
170
+ }
171
+ ```
172
+
173
+ **PhoneVerifyResponse** (interface)
174
+ ```typescript
175
+ interface PhoneVerifyResponse {
176
+ token: string
177
+ user: AuthKitUser
178
+ }
179
+ ```
180
+
181
+ **PasswordResetRequestResponse** (interface)
182
+ ```typescript
183
+ interface PasswordResetRequestResponse {
184
+ success: boolean
185
+ message: string
186
+ }
187
+ ```
188
+
189
+ **VerifyResetTokenResponse** (interface)
190
+ ```typescript
191
+ interface VerifyResetTokenResponse {
192
+ valid: boolean
193
+ email?: string
194
+ expiresAt?: number
195
+ message?: string
196
+ }
197
+ ```
198
+
199
+ **PasswordResetCompleteResponse** (interface)
200
+ ```typescript
201
+ interface PasswordResetCompleteResponse {
202
+ success: boolean
203
+ message: string
204
+ }
205
+ ```
206
+
207
+ **EmailVerificationActionResponse** (interface)
208
+ ```typescript
209
+ interface EmailVerificationActionResponse {
210
+ success: boolean
211
+ message: string
212
+ }
213
+ ```
214
+
215
+ **EmailVerifyTokenResponse** (interface)
216
+ ```typescript
217
+ interface EmailVerifyTokenResponse {
218
+ success: boolean
219
+ message: string
220
+ token?: string
221
+ user?: AuthKitUser
222
+ }
223
+ ```
224
+
225
+ **AuthKitBrandingConfig** (interface)
226
+ ```typescript
227
+ interface AuthKitBrandingConfig {
228
+ logoUrl?: string
229
+ title?: string
230
+ subtitle?: string
231
+ primaryColor?: string
232
+ secondaryColor?: string
233
+ backgroundColor?: string
234
+ buttonStyle?: string
235
+ fontFamily?: string
236
+ }
237
+ ```
238
+
239
+ **AuthKitConfig** (interface)
240
+ ```typescript
241
+ interface AuthKitConfig {
242
+ clientId: string
243
+ branding?: AuthKitBrandingConfig
244
+ enabledProviders?: string[]
245
+ customCss?: string
246
+ termsUrl?: string
247
+ privacyUrl?: string
248
+ supportEmail?: string
249
+ redirectUrl?: string
250
+ updatedAt?: string
251
+ }
252
+ ```
253
+
140
254
  ### batch
141
255
 
142
256
  **BatchResponse** = `any`
@@ -645,6 +759,59 @@ Admin: Get a user bearer token (impersonation/automation). POST /admin/auth/user
645
759
  **getAccount**() → `Promise<AccountInfoResponse>`
646
760
  Gets current account information for the logged in user. Returns user, owner, account, and location objects.
647
761
 
762
+ ### authKit
763
+
764
+ **login**(clientId: string, email: string, password: string) → `Promise<AuthLoginResponse>`
765
+ Login with email + password (public).
766
+
767
+ **register**(clientId: string, data: { email: string; password: string; displayName?: string; accountData?: Record<string, any> }) → `Promise<AuthLoginResponse>`
768
+ Register a new user (public).
769
+
770
+ **googleLogin**(clientId: string, idToken: string) → `Promise<AuthLoginResponse>`
771
+ Google OAuth login (public).
772
+
773
+ **sendPhoneCode**(clientId: string, phoneNumber: string) → `Promise<PhoneSendCodeResponse>`
774
+ Send phone verification code (public).
775
+
776
+ **verifyPhoneCode**(clientId: string, verificationId: string, code: string) → `Promise<PhoneVerifyResponse>`
777
+ Verify phone verification code (public).
778
+
779
+ **requestPasswordReset**(clientId: string, data: { email: string; redirectUrl?: string; clientName?: string }) → `Promise<PasswordResetRequestResponse>`
780
+ Verify phone verification code (public).
781
+
782
+ **verifyResetToken**(clientId: string, token: string) → `Promise<VerifyResetTokenResponse>`
783
+ Verify phone verification code (public).
784
+
785
+ **completePasswordReset**(clientId: string, token: string, newPassword: string) → `Promise<PasswordResetCompleteResponse>`
786
+ Verify phone verification code (public).
787
+
788
+ **sendEmailVerification**(clientId: string, data: { userId: string; email: string; redirectUrl?: string; clientName?: string }) → `Promise<EmailVerificationActionResponse>`
789
+ Verify phone verification code (public).
790
+
791
+ **verifyEmail**(clientId: string, token: string) → `Promise<EmailVerifyTokenResponse>`
792
+ Verify phone verification code (public).
793
+
794
+ **resendEmailVerification**(clientId: string, data: { userId: string; email: string; redirectUrl?: string; clientName?: string }) → `Promise<EmailVerificationActionResponse>`
795
+ Verify phone verification code (public).
796
+
797
+ **load**(authKitId: string) → `Promise<AuthKitConfig>`
798
+ Verify phone verification code (public).
799
+
800
+ **get**(collectionId: string, authKitId: string) → `Promise<AuthKitConfig>`
801
+ Verify phone verification code (public).
802
+
803
+ **list**(collectionId: string, admin?: boolean) → `Promise<AuthKitConfig[]>`
804
+ Verify phone verification code (public).
805
+
806
+ **create**(collectionId: string, data: any) → `Promise<AuthKitConfig>`
807
+ Verify phone verification code (public).
808
+
809
+ **update**(collectionId: string, authKitId: string, data: any) → `Promise<AuthKitConfig>`
810
+ Verify phone verification code (public).
811
+
812
+ **remove**(collectionId: string, authKitId: string) → `Promise<void>`
813
+ Verify phone verification code (public).
814
+
648
815
  ### batch
649
816
 
650
817
  **get**(collectionId: string,
@@ -0,0 +1,48 @@
1
+ import type { AuthLoginResponse, PhoneSendCodeResponse, PhoneVerifyResponse, PasswordResetRequestResponse, VerifyResetTokenResponse, PasswordResetCompleteResponse, EmailVerificationActionResponse, EmailVerifyTokenResponse, AuthKitConfig } from "../types/authKit";
2
+ /**
3
+ * Namespace containing helper functions for the new AuthKit API.
4
+ * Legacy collection-based authKit helpers retained (marked as *Legacy*).
5
+ */
6
+ export declare namespace authKit {
7
+ /** Login with email + password (public). */
8
+ function login(clientId: string, email: string, password: string): Promise<AuthLoginResponse>;
9
+ /** Register a new user (public). */
10
+ function register(clientId: string, data: {
11
+ email: string;
12
+ password: string;
13
+ displayName?: string;
14
+ accountData?: Record<string, any>;
15
+ }): Promise<AuthLoginResponse>;
16
+ /** Google OAuth login (public). */
17
+ function googleLogin(clientId: string, idToken: string): Promise<AuthLoginResponse>;
18
+ /** Send phone verification code (public). */
19
+ function sendPhoneCode(clientId: string, phoneNumber: string): Promise<PhoneSendCodeResponse>;
20
+ /** Verify phone verification code (public). */
21
+ function verifyPhoneCode(clientId: string, verificationId: string, code: string): Promise<PhoneVerifyResponse>;
22
+ function requestPasswordReset(clientId: string, data: {
23
+ email: string;
24
+ redirectUrl?: string;
25
+ clientName?: string;
26
+ }): Promise<PasswordResetRequestResponse>;
27
+ function verifyResetToken(clientId: string, token: string): Promise<VerifyResetTokenResponse>;
28
+ function completePasswordReset(clientId: string, token: string, newPassword: string): Promise<PasswordResetCompleteResponse>;
29
+ function sendEmailVerification(clientId: string, data: {
30
+ userId: string;
31
+ email: string;
32
+ redirectUrl?: string;
33
+ clientName?: string;
34
+ }): Promise<EmailVerificationActionResponse>;
35
+ function verifyEmail(clientId: string, token: string): Promise<EmailVerifyTokenResponse>;
36
+ function resendEmailVerification(clientId: string, data: {
37
+ userId: string;
38
+ email: string;
39
+ redirectUrl?: string;
40
+ clientName?: string;
41
+ }): Promise<EmailVerificationActionResponse>;
42
+ function load(authKitId: string): Promise<AuthKitConfig>;
43
+ function get(collectionId: string, authKitId: string): Promise<AuthKitConfig>;
44
+ function list(collectionId: string, admin?: boolean): Promise<AuthKitConfig[]>;
45
+ function create(collectionId: string, data: any): Promise<AuthKitConfig>;
46
+ function update(collectionId: string, authKitId: string, data: any): Promise<AuthKitConfig>;
47
+ function remove(collectionId: string, authKitId: string): Promise<void>;
48
+ }
@@ -0,0 +1,100 @@
1
+ import { request, post, put, del } from "../http";
2
+ /**
3
+ * Namespace containing helper functions for the new AuthKit API.
4
+ * Legacy collection-based authKit helpers retained (marked as *Legacy*).
5
+ */
6
+ export var authKit;
7
+ (function (authKit) {
8
+ /* ===================================
9
+ * Authentication (Per client)
10
+ * =================================== */
11
+ /** Login with email + password (public). */
12
+ async function login(clientId, email, password) {
13
+ return post(`/authkit/${encodeURIComponent(clientId)}/auth/login`, { email, password });
14
+ }
15
+ authKit.login = login;
16
+ /** Register a new user (public). */
17
+ async function register(clientId, data) {
18
+ return post(`/authkit/${encodeURIComponent(clientId)}/auth/register`, data);
19
+ }
20
+ authKit.register = register;
21
+ /** Google OAuth login (public). */
22
+ async function googleLogin(clientId, idToken) {
23
+ return post(`/authkit/${encodeURIComponent(clientId)}/auth/google`, { idToken });
24
+ }
25
+ authKit.googleLogin = googleLogin;
26
+ /** Send phone verification code (public). */
27
+ async function sendPhoneCode(clientId, phoneNumber) {
28
+ return post(`/authkit/${encodeURIComponent(clientId)}/auth/phone/send-code`, { phoneNumber });
29
+ }
30
+ authKit.sendPhoneCode = sendPhoneCode;
31
+ /** Verify phone verification code (public). */
32
+ async function verifyPhoneCode(clientId, verificationId, code) {
33
+ return post(`/authkit/${encodeURIComponent(clientId)}/auth/phone/verify`, { verificationId, code });
34
+ }
35
+ authKit.verifyPhoneCode = verifyPhoneCode;
36
+ /* ===================================
37
+ * Password Reset (Public flows)
38
+ * =================================== */
39
+ async function requestPasswordReset(clientId, data) {
40
+ return post(`/authkit/${encodeURIComponent(clientId)}/auth/reset-password`, data);
41
+ }
42
+ authKit.requestPasswordReset = requestPasswordReset;
43
+ async function verifyResetToken(clientId, token) {
44
+ return post(`/authkit/${encodeURIComponent(clientId)}/auth/verify-reset-token`, { token });
45
+ }
46
+ authKit.verifyResetToken = verifyResetToken;
47
+ async function completePasswordReset(clientId, token, newPassword) {
48
+ return post(`/authkit/${encodeURIComponent(clientId)}/auth/complete-reset`, { token, newPassword });
49
+ }
50
+ authKit.completePasswordReset = completePasswordReset;
51
+ /* ===================================
52
+ * Email Verification
53
+ * =================================== */
54
+ async function sendEmailVerification(clientId, data) {
55
+ return post(`/authkit/${encodeURIComponent(clientId)}/auth/send-verification`, data);
56
+ }
57
+ authKit.sendEmailVerification = sendEmailVerification;
58
+ async function verifyEmail(clientId, token) {
59
+ return post(`/authkit/${encodeURIComponent(clientId)}/auth/verify-email`, { token });
60
+ }
61
+ authKit.verifyEmail = verifyEmail;
62
+ async function resendEmailVerification(clientId, data) {
63
+ return post(`/authkit/${encodeURIComponent(clientId)}/auth/resend-verification`, data);
64
+ }
65
+ authKit.resendEmailVerification = resendEmailVerification;
66
+ /* ===================================
67
+ * Collection-based AuthKit
68
+ * =================================== */
69
+ async function load(authKitId) {
70
+ const path = `authKit/${encodeURIComponent(authKitId)}`;
71
+ return request(path);
72
+ }
73
+ authKit.load = load;
74
+ async function get(collectionId, authKitId) {
75
+ const path = `admin/collection/${encodeURIComponent(collectionId)}/authKit/${encodeURIComponent(authKitId)}`;
76
+ return request(path);
77
+ }
78
+ authKit.get = get;
79
+ async function list(collectionId, admin) {
80
+ const base = admin ? "/admin" : "/public";
81
+ const path = `${base}/collection/${encodeURIComponent(collectionId)}/authKit`;
82
+ return request(path);
83
+ }
84
+ authKit.list = list;
85
+ async function create(collectionId, data) {
86
+ const path = `/admin/collection/${encodeURIComponent(collectionId)}/authKit`;
87
+ return post(path, data);
88
+ }
89
+ authKit.create = create;
90
+ async function update(collectionId, authKitId, data) {
91
+ const path = `/admin/collection/${encodeURIComponent(collectionId)}/authKit/${encodeURIComponent(authKitId)}`;
92
+ return put(path, data);
93
+ }
94
+ authKit.update = update;
95
+ async function remove(collectionId, authKitId) {
96
+ const path = `/admin/collection/${encodeURIComponent(collectionId)}/authKit/${encodeURIComponent(authKitId)}`;
97
+ return del(path);
98
+ }
99
+ authKit.remove = remove;
100
+ })(authKit || (authKit = {}));
@@ -7,6 +7,7 @@ export { asset } from "./asset";
7
7
  export { attestation } from "./attestation";
8
8
  export { auth } from "./auth";
9
9
  export { form } from "./form";
10
+ export { authKit } from "./authKit";
10
11
  export { claimSet } from "./claimSet";
11
12
  export { crate } from "./crate";
12
13
  export { batch } from "./batch";
package/dist/api/index.js CHANGED
@@ -9,6 +9,7 @@ export { asset } from "./asset";
9
9
  export { attestation } from "./attestation";
10
10
  export { auth } from "./auth";
11
11
  export { form } from "./form";
12
+ export { authKit } from "./authKit";
12
13
  export { claimSet } from "./claimSet";
13
14
  export { crate } from "./crate";
14
15
  export { batch } from "./batch";
@@ -0,0 +1,67 @@
1
+ export interface AuthKitUser {
2
+ uid: string;
3
+ email?: string;
4
+ displayName?: string | null;
5
+ photoURL?: string | null;
6
+ phoneNumber?: string | null;
7
+ emailVerified?: boolean;
8
+ accountData?: Record<string, any>;
9
+ }
10
+ export interface AuthLoginResponse {
11
+ token: string;
12
+ user: AuthKitUser;
13
+ accountData?: Record<string, any>;
14
+ }
15
+ export interface PhoneSendCodeResponse {
16
+ verificationId: string;
17
+ message: string;
18
+ }
19
+ export interface PhoneVerifyResponse {
20
+ token: string;
21
+ user: AuthKitUser;
22
+ }
23
+ export interface PasswordResetRequestResponse {
24
+ success: boolean;
25
+ message: string;
26
+ }
27
+ export interface VerifyResetTokenResponse {
28
+ valid: boolean;
29
+ email?: string;
30
+ expiresAt?: number;
31
+ message?: string;
32
+ }
33
+ export interface PasswordResetCompleteResponse {
34
+ success: boolean;
35
+ message: string;
36
+ }
37
+ export interface EmailVerificationActionResponse {
38
+ success: boolean;
39
+ message: string;
40
+ }
41
+ export interface EmailVerifyTokenResponse {
42
+ success: boolean;
43
+ message: string;
44
+ token?: string;
45
+ user?: AuthKitUser;
46
+ }
47
+ export interface AuthKitBrandingConfig {
48
+ logoUrl?: string;
49
+ title?: string;
50
+ subtitle?: string;
51
+ primaryColor?: string;
52
+ secondaryColor?: string;
53
+ backgroundColor?: string;
54
+ buttonStyle?: string;
55
+ fontFamily?: string;
56
+ }
57
+ export interface AuthKitConfig {
58
+ clientId: string;
59
+ branding?: AuthKitBrandingConfig;
60
+ enabledProviders?: string[];
61
+ customCss?: string;
62
+ termsUrl?: string;
63
+ privacyUrl?: string;
64
+ supportEmail?: string;
65
+ redirectUrl?: string;
66
+ updatedAt?: string;
67
+ }
@@ -0,0 +1,2 @@
1
+ // Types for the AuthKit API
2
+ export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@proveanything/smartlinks",
3
- "version": "1.0.42",
3
+ "version": "1.0.43",
4
4
  "description": "Official JavaScript/TypeScript SDK for the Smartlinks API",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",