@proveanything/smartlinks 1.14.16 → 1.14.17

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.
@@ -96,6 +96,11 @@ export declare namespace authKit {
96
96
  clientName?: string;
97
97
  }): Promise<PasswordResetRequestResponse>;
98
98
  function verifyResetToken(clientId: string, token: string): Promise<VerifyResetTokenResponse>;
99
+ /**
100
+ * Complete a password reset / invite acceptance. On invite acceptance under
101
+ * `verify-auto-login` the server returns a session — adopt it so the caller is logged
102
+ * straight in (plain resets return no token and leave the bearer untouched).
103
+ */
99
104
  function completePasswordReset(clientId: string, token: string, newPassword: string): Promise<PasswordResetCompleteResponse>;
100
105
  function sendEmailVerification(clientId: string, data: {
101
106
  userId: string;
@@ -103,6 +108,7 @@ export declare namespace authKit {
103
108
  redirectUrl?: string;
104
109
  clientName?: string;
105
110
  }): Promise<EmailVerificationActionResponse>;
111
+ /** Verify an email token; under `verify-auto-login` the server returns a session — adopt it. */
106
112
  function verifyEmail(clientId: string, token: string): Promise<EmailVerifyTokenResponse>;
107
113
  function resendEmailVerification(clientId: string, data: {
108
114
  userId: string;
@@ -197,8 +197,18 @@ export var authKit;
197
197
  return post(`/authkit/${encodeURIComponent(clientId)}/auth/verify-reset-token`, { token });
198
198
  }
199
199
  authKit.verifyResetToken = verifyResetToken;
200
+ /**
201
+ * Complete a password reset / invite acceptance. On invite acceptance under
202
+ * `verify-auto-login` the server returns a session — adopt it so the caller is logged
203
+ * straight in (plain resets return no token and leave the bearer untouched).
204
+ */
200
205
  async function completePasswordReset(clientId, token, newPassword) {
201
- return post(`/authkit/${encodeURIComponent(clientId)}/auth/complete-reset`, { token, newPassword });
206
+ const res = await post(`/authkit/${encodeURIComponent(clientId)}/auth/complete-reset`, { token, newPassword });
207
+ if (res.token) {
208
+ setBearerToken(res.token);
209
+ invalidateCache();
210
+ }
211
+ return res;
202
212
  }
203
213
  authKit.completePasswordReset = completePasswordReset;
204
214
  /* ===================================
@@ -208,8 +218,14 @@ export var authKit;
208
218
  return post(`/authkit/${encodeURIComponent(clientId)}/auth/send-verification`, data);
209
219
  }
210
220
  authKit.sendEmailVerification = sendEmailVerification;
221
+ /** Verify an email token; under `verify-auto-login` the server returns a session — adopt it. */
211
222
  async function verifyEmail(clientId, token) {
212
- return post(`/authkit/${encodeURIComponent(clientId)}/auth/verify-email`, { token });
223
+ const res = await post(`/authkit/${encodeURIComponent(clientId)}/auth/verify-email`, { token });
224
+ if (res.token) {
225
+ setBearerToken(res.token);
226
+ invalidateCache();
227
+ }
228
+ return res;
213
229
  }
214
230
  authKit.verifyEmail = verifyEmail;
215
231
  async function resendEmailVerification(clientId, data) {
@@ -1,6 +1,6 @@
1
1
  # Smartlinks API Summary
2
2
 
3
- Version: 1.14.16 | Generated: 2026-06-01T09:33:51.336Z
3
+ Version: 1.14.17 | Generated: 2026-06-02T16:17:46.100Z
4
4
 
5
5
  This is a concise summary of all available API functions and types.
6
6
 
@@ -3053,6 +3053,13 @@ interface VerifyResetTokenResponse {
3053
3053
  interface PasswordResetCompleteResponse {
3054
3054
  success: boolean
3055
3055
  message: string
3056
+ token?: string
3057
+ user?: AuthKitUser
3058
+ accountData?: Record<string, any> | null
3059
+ emailVerificationMode?: 'immediate' | 'verify-auto-login' | 'verify-manual-login'
3060
+ refreshToken?: string
3061
+ refreshTokenExpiresAt?: number
3062
+ expiresAt?: number
3056
3063
  }
3057
3064
  ```
3058
3065
 
@@ -8371,19 +8378,19 @@ Upsert contact identity after lightweight verification (public).
8371
8378
  Upsert contact identity after lightweight verification (public).
8372
8379
 
8373
8380
  **completePasswordReset**(clientId: string, token: string, newPassword: string) → `Promise<PasswordResetCompleteResponse>`
8374
- Upsert contact identity after lightweight verification (public).
8381
+ Complete a password reset / invite acceptance. On invite acceptance under `verify-auto-login` the server returns a session — adopt it so the caller is logged straight in (plain resets return no token and leave the bearer untouched).
8375
8382
 
8376
8383
  **sendEmailVerification**(clientId: string, data: { userId: string; email: string; redirectUrl?: string; clientName?: string }) → `Promise<EmailVerificationActionResponse>`
8377
- Upsert contact identity after lightweight verification (public).
8384
+ Complete a password reset / invite acceptance. On invite acceptance under `verify-auto-login` the server returns a session — adopt it so the caller is logged straight in (plain resets return no token and leave the bearer untouched).
8378
8385
 
8379
8386
  **verifyEmail**(clientId: string, token: string) → `Promise<EmailVerifyTokenResponse>`
8380
- Upsert contact identity after lightweight verification (public).
8387
+ Verify an email token; under `verify-auto-login` the server returns a session — adopt it.
8381
8388
 
8382
8389
  **resendEmailVerification**(clientId: string, data: { userId: string; email: string; redirectUrl?: string; clientName?: string }) → `Promise<EmailVerificationActionResponse>`
8383
- Upsert contact identity after lightweight verification (public).
8390
+ Verify an email token; under `verify-auto-login` the server returns a session — adopt it.
8384
8391
 
8385
8392
  **getProfile**(clientId: string) → `Promise<UserProfile>`
8386
- Upsert contact identity after lightweight verification (public).
8393
+ Verify an email token; under `verify-auto-login` the server returns a session — adopt it.
8387
8394
 
8388
8395
  **updateProfile**(clientId: string, data: ProfileUpdateData) → `Promise<UpdateProfileResponse>`
8389
8396
  Update the authenticated user's profile and replace the bearer token when refreshed claims are returned.
package/dist/openapi.yaml CHANGED
@@ -8071,7 +8071,7 @@ paths:
8071
8071
  get:
8072
8072
  tags:
8073
8073
  - authKit
8074
- summary: authKit.getProfile
8074
+ summary: "Verify an email token; under `verify-auto-login` the server returns a session — adopt it."
8075
8075
  operationId: authKit_getProfile
8076
8076
  security: []
8077
8077
  parameters:
@@ -8213,7 +8213,7 @@ paths:
8213
8213
  post:
8214
8214
  tags:
8215
8215
  - authKit
8216
- summary: authKit.completePasswordReset
8216
+ summary: Complete a password reset / invite acceptance.
8217
8217
  operationId: authKit_completePasswordReset
8218
8218
  security: []
8219
8219
  parameters:
@@ -8579,7 +8579,7 @@ paths:
8579
8579
  post:
8580
8580
  tags:
8581
8581
  - authKit
8582
- summary: authKit.sendEmailVerification
8582
+ summary: Complete a password reset / invite acceptance.
8583
8583
  operationId: authKit_sendEmailVerification
8584
8584
  security: []
8585
8585
  parameters:
@@ -8670,7 +8670,7 @@ paths:
8670
8670
  post:
8671
8671
  tags:
8672
8672
  - authKit
8673
- summary: authKit.verifyEmail
8673
+ summary: "Verify an email token; under `verify-auto-login` the server returns a session — adopt it."
8674
8674
  operationId: authKit_verifyEmail
8675
8675
  security: []
8676
8676
  parameters:
@@ -18126,6 +18126,25 @@ components:
18126
18126
  type: boolean
18127
18127
  message:
18128
18128
  type: string
18129
+ token:
18130
+ type: string
18131
+ user:
18132
+ $ref: "#/components/schemas/AuthKitUser"
18133
+ accountData:
18134
+ type: object
18135
+ additionalProperties: true
18136
+ emailVerificationMode:
18137
+ type: string
18138
+ enum:
18139
+ - immediate
18140
+ - verify-auto-login
18141
+ - verify-manual-login
18142
+ refreshToken:
18143
+ type: string
18144
+ refreshTokenExpiresAt:
18145
+ type: number
18146
+ expiresAt:
18147
+ type: number
18129
18148
  required:
18130
18149
  - success
18131
18150
  - message
@@ -144,9 +144,36 @@ export interface VerifyResetTokenResponse {
144
144
  expiresAt?: number;
145
145
  message?: string;
146
146
  }
147
+ /**
148
+ * Response from {@link authKit.completePasswordReset}.
149
+ *
150
+ * For a **plain password reset**, or an invite accepted under `verify-manual-login`,
151
+ * the server returns only `success` + `message` and the user is sent to the login screen.
152
+ *
153
+ * For **invite acceptance under `verify-auto-login`** (the default), the server also
154
+ * completes email verification and returns a full session — `token`, `user`, and
155
+ * `accountData` — so the user can be logged straight in, mirroring
156
+ * {@link EmailVerifyTokenResponse}. The native-only fields are populated when the request
157
+ * opted in via `initializeApi({ platform: 'native' })` (the `X-Client-Platform: native`
158
+ * header). Every session field is therefore optional.
159
+ */
147
160
  export interface PasswordResetCompleteResponse {
148
161
  success: boolean;
149
162
  message: string;
163
+ /** Session token (a `SL.` bearer JWT). Present only on invite auto-login. Adopt it and skip the login screen. */
164
+ token?: string;
165
+ /** The authenticated user. Present only when a `token` is returned. `emailVerified` is `true` once completion verifies the invite. */
166
+ user?: AuthKitUser;
167
+ /** The `clients[clientId]` account-data slice, or `null`. Present only when a `token` is returned. */
168
+ accountData?: Record<string, any> | null;
169
+ /** Configured verification mode echoed back; auto-login only occurs for `verify-auto-login`. */
170
+ emailVerificationMode?: 'immediate' | 'verify-auto-login' | 'verify-manual-login';
171
+ /** Opaque, single-use refresh token. **Native clients only** — pairs with the short-lived `token`. */
172
+ refreshToken?: string;
173
+ /** Absolute expiry of the refresh-token family, in **ms since epoch**. Native only. */
174
+ refreshTokenExpiresAt?: number;
175
+ /** Access-token expiry, in **ms since epoch**. Native only. */
176
+ expiresAt?: number;
150
177
  }
151
178
  export interface EmailVerificationActionResponse {
152
179
  success: boolean;
@@ -1,6 +1,6 @@
1
1
  # Smartlinks API Summary
2
2
 
3
- Version: 1.14.16 | Generated: 2026-06-01T09:33:51.336Z
3
+ Version: 1.14.17 | Generated: 2026-06-02T16:17:46.100Z
4
4
 
5
5
  This is a concise summary of all available API functions and types.
6
6
 
@@ -3053,6 +3053,13 @@ interface VerifyResetTokenResponse {
3053
3053
  interface PasswordResetCompleteResponse {
3054
3054
  success: boolean
3055
3055
  message: string
3056
+ token?: string
3057
+ user?: AuthKitUser
3058
+ accountData?: Record<string, any> | null
3059
+ emailVerificationMode?: 'immediate' | 'verify-auto-login' | 'verify-manual-login'
3060
+ refreshToken?: string
3061
+ refreshTokenExpiresAt?: number
3062
+ expiresAt?: number
3056
3063
  }
3057
3064
  ```
3058
3065
 
@@ -8371,19 +8378,19 @@ Upsert contact identity after lightweight verification (public).
8371
8378
  Upsert contact identity after lightweight verification (public).
8372
8379
 
8373
8380
  **completePasswordReset**(clientId: string, token: string, newPassword: string) → `Promise<PasswordResetCompleteResponse>`
8374
- Upsert contact identity after lightweight verification (public).
8381
+ Complete a password reset / invite acceptance. On invite acceptance under `verify-auto-login` the server returns a session — adopt it so the caller is logged straight in (plain resets return no token and leave the bearer untouched).
8375
8382
 
8376
8383
  **sendEmailVerification**(clientId: string, data: { userId: string; email: string; redirectUrl?: string; clientName?: string }) → `Promise<EmailVerificationActionResponse>`
8377
- Upsert contact identity after lightweight verification (public).
8384
+ Complete a password reset / invite acceptance. On invite acceptance under `verify-auto-login` the server returns a session — adopt it so the caller is logged straight in (plain resets return no token and leave the bearer untouched).
8378
8385
 
8379
8386
  **verifyEmail**(clientId: string, token: string) → `Promise<EmailVerifyTokenResponse>`
8380
- Upsert contact identity after lightweight verification (public).
8387
+ Verify an email token; under `verify-auto-login` the server returns a session — adopt it.
8381
8388
 
8382
8389
  **resendEmailVerification**(clientId: string, data: { userId: string; email: string; redirectUrl?: string; clientName?: string }) → `Promise<EmailVerificationActionResponse>`
8383
- Upsert contact identity after lightweight verification (public).
8390
+ Verify an email token; under `verify-auto-login` the server returns a session — adopt it.
8384
8391
 
8385
8392
  **getProfile**(clientId: string) → `Promise<UserProfile>`
8386
- Upsert contact identity after lightweight verification (public).
8393
+ Verify an email token; under `verify-auto-login` the server returns a session — adopt it.
8387
8394
 
8388
8395
  **updateProfile**(clientId: string, data: ProfileUpdateData) → `Promise<UpdateProfileResponse>`
8389
8396
  Update the authenticated user's profile and replace the bearer token when refreshed claims are returned.
package/openapi.yaml CHANGED
@@ -8071,7 +8071,7 @@ paths:
8071
8071
  get:
8072
8072
  tags:
8073
8073
  - authKit
8074
- summary: authKit.getProfile
8074
+ summary: "Verify an email token; under `verify-auto-login` the server returns a session — adopt it."
8075
8075
  operationId: authKit_getProfile
8076
8076
  security: []
8077
8077
  parameters:
@@ -8213,7 +8213,7 @@ paths:
8213
8213
  post:
8214
8214
  tags:
8215
8215
  - authKit
8216
- summary: authKit.completePasswordReset
8216
+ summary: Complete a password reset / invite acceptance.
8217
8217
  operationId: authKit_completePasswordReset
8218
8218
  security: []
8219
8219
  parameters:
@@ -8579,7 +8579,7 @@ paths:
8579
8579
  post:
8580
8580
  tags:
8581
8581
  - authKit
8582
- summary: authKit.sendEmailVerification
8582
+ summary: Complete a password reset / invite acceptance.
8583
8583
  operationId: authKit_sendEmailVerification
8584
8584
  security: []
8585
8585
  parameters:
@@ -8670,7 +8670,7 @@ paths:
8670
8670
  post:
8671
8671
  tags:
8672
8672
  - authKit
8673
- summary: authKit.verifyEmail
8673
+ summary: "Verify an email token; under `verify-auto-login` the server returns a session — adopt it."
8674
8674
  operationId: authKit_verifyEmail
8675
8675
  security: []
8676
8676
  parameters:
@@ -18126,6 +18126,25 @@ components:
18126
18126
  type: boolean
18127
18127
  message:
18128
18128
  type: string
18129
+ token:
18130
+ type: string
18131
+ user:
18132
+ $ref: "#/components/schemas/AuthKitUser"
18133
+ accountData:
18134
+ type: object
18135
+ additionalProperties: true
18136
+ emailVerificationMode:
18137
+ type: string
18138
+ enum:
18139
+ - immediate
18140
+ - verify-auto-login
18141
+ - verify-manual-login
18142
+ refreshToken:
18143
+ type: string
18144
+ refreshTokenExpiresAt:
18145
+ type: number
18146
+ expiresAt:
18147
+ type: number
18129
18148
  required:
18130
18149
  - success
18131
18150
  - message
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@proveanything/smartlinks",
3
- "version": "1.14.16",
3
+ "version": "1.14.17",
4
4
  "description": "Official JavaScript/TypeScript SDK for the Smartlinks API",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",