@proveanything/smartlinks 1.13.16 → 1.13.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.
@@ -1,4 +1,4 @@
1
- import type { AuthLoginResponse, PhoneSendCodeResponse, PhoneVerifyResponse, PasswordResetRequestResponse, VerifyResetTokenResponse, PasswordResetCompleteResponse, EmailVerificationActionResponse, EmailVerifyTokenResponse, AuthKitConfig, MagicLinkSendResponse, MagicLinkVerifyResponse, UserProfile, ProfileUpdateData, SuccessResponse, SendWhatsAppRequest, SendWhatsAppResponse, ExchangeWhatsAppSessionResponse, VerifyWhatsAppResponse, WhatsAppStatusResponse, SendSmsVerifyRequest, SendSmsVerifyResponse, VerifySmsResponse, UpsertContactRequest, UpsertContactResponse } from "../types/authKit";
1
+ import type { AuthLoginResponse, PhoneSendCodeResponse, PhoneVerifyResponse, PasswordResetRequestResponse, VerifyResetTokenResponse, PasswordResetCompleteResponse, EmailVerificationActionResponse, EmailVerifyTokenResponse, AuthKitConfig, MagicLinkSendResponse, MagicLinkVerifyResponse, UserProfile, UpdateProfileResponse, ProfileUpdateData, SuccessResponse, SendWhatsAppRequest, SendWhatsAppResponse, ExchangeWhatsAppSessionResponse, VerifyWhatsAppResponse, WhatsAppStatusResponse, SendSmsVerifyRequest, SendSmsVerifyResponse, VerifySmsResponse, UpsertContactRequest, UpsertContactResponse } 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*).
@@ -62,7 +62,8 @@ export declare namespace authKit {
62
62
  clientName?: string;
63
63
  }): Promise<EmailVerificationActionResponse>;
64
64
  function getProfile(clientId: string): Promise<UserProfile>;
65
- function updateProfile(clientId: string, data: ProfileUpdateData): Promise<UserProfile>;
65
+ /** Update the authenticated user's profile and replace the bearer token when refreshed claims are returned. */
66
+ function updateProfile(clientId: string, data: ProfileUpdateData): Promise<UpdateProfileResponse>;
66
67
  function changePassword(clientId: string, currentPassword: string, newPassword: string): Promise<SuccessResponse>;
67
68
  function changeEmail(clientId: string, newEmail: string, password: string, redirectUrl: string): Promise<SuccessResponse>;
68
69
  function verifyEmailChange(clientId: string, token: string): Promise<SuccessResponse>;
@@ -122,8 +122,12 @@ export var authKit;
122
122
  return request(`/authkit/${encodeURIComponent(clientId)}/account/profile`);
123
123
  }
124
124
  authKit.getProfile = getProfile;
125
+ /** Update the authenticated user's profile and replace the bearer token when refreshed claims are returned. */
125
126
  async function updateProfile(clientId, data) {
126
- return post(`/authkit/${encodeURIComponent(clientId)}/account/update-profile`, data);
127
+ const res = await post(`/authkit/${encodeURIComponent(clientId)}/account/update-profile`, data);
128
+ if (res.token)
129
+ setBearerToken(res.token);
130
+ return res;
127
131
  }
128
132
  authKit.updateProfile = updateProfile;
129
133
  async function changePassword(clientId, currentPassword, newPassword) {
@@ -1,6 +1,6 @@
1
1
  # Smartlinks API Summary
2
2
 
3
- Version: 1.13.16 | Generated: 2026-05-15T19:36:34.712Z
3
+ Version: 1.13.17 | Generated: 2026-05-15T20:47:03.471Z
4
4
 
5
5
  This is a concise summary of all available API functions and types.
6
6
 
@@ -8282,41 +8282,41 @@ Upsert contact identity after lightweight verification (public).
8282
8282
  **getProfile**(clientId: string) → `Promise<UserProfile>`
8283
8283
  Upsert contact identity after lightweight verification (public).
8284
8284
 
8285
- **updateProfile**(clientId: string, data: ProfileUpdateData) → `Promise<UserProfile>`
8286
- Upsert contact identity after lightweight verification (public).
8285
+ **updateProfile**(clientId: string, data: ProfileUpdateData) → `Promise<UpdateProfileResponse>`
8286
+ Update the authenticated user's profile and replace the bearer token when refreshed claims are returned.
8287
8287
 
8288
8288
  **changePassword**(clientId: string, currentPassword: string, newPassword: string) → `Promise<SuccessResponse>`
8289
- Upsert contact identity after lightweight verification (public).
8289
+ Update the authenticated user's profile and replace the bearer token when refreshed claims are returned.
8290
8290
 
8291
8291
  **changeEmail**(clientId: string, newEmail: string, password: string, redirectUrl: string) → `Promise<SuccessResponse>`
8292
- Upsert contact identity after lightweight verification (public).
8292
+ Update the authenticated user's profile and replace the bearer token when refreshed claims are returned.
8293
8293
 
8294
8294
  **verifyEmailChange**(clientId: string, token: string) → `Promise<SuccessResponse>`
8295
- Upsert contact identity after lightweight verification (public).
8295
+ Update the authenticated user's profile and replace the bearer token when refreshed claims are returned.
8296
8296
 
8297
8297
  **updatePhone**(clientId: string, phoneNumber: string, verificationCode: string) → `Promise<SuccessResponse>`
8298
- Upsert contact identity after lightweight verification (public).
8298
+ Update the authenticated user's profile and replace the bearer token when refreshed claims are returned.
8299
8299
 
8300
8300
  **deleteAccount**(clientId: string, password: string, confirmText: string) → `Promise<SuccessResponse>`
8301
- Upsert contact identity after lightweight verification (public).
8301
+ Update the authenticated user's profile and replace the bearer token when refreshed claims are returned.
8302
8302
 
8303
8303
  **load**(authKitId: string) → `Promise<AuthKitConfig>`
8304
- Upsert contact identity after lightweight verification (public).
8304
+ Update the authenticated user's profile and replace the bearer token when refreshed claims are returned.
8305
8305
 
8306
8306
  **get**(collectionId: string, authKitId: string) → `Promise<AuthKitConfig>`
8307
- Upsert contact identity after lightweight verification (public).
8307
+ Update the authenticated user's profile and replace the bearer token when refreshed claims are returned.
8308
8308
 
8309
8309
  **list**(collectionId: string, admin?: boolean) → `Promise<AuthKitConfig[]>`
8310
- Upsert contact identity after lightweight verification (public).
8310
+ Update the authenticated user's profile and replace the bearer token when refreshed claims are returned.
8311
8311
 
8312
8312
  **create**(collectionId: string, data: any) → `Promise<AuthKitConfig>`
8313
- Upsert contact identity after lightweight verification (public).
8313
+ Update the authenticated user's profile and replace the bearer token when refreshed claims are returned.
8314
8314
 
8315
8315
  **update**(collectionId: string, authKitId: string, data: any) → `Promise<AuthKitConfig>`
8316
- Upsert contact identity after lightweight verification (public).
8316
+ Update the authenticated user's profile and replace the bearer token when refreshed claims are returned.
8317
8317
 
8318
8318
  **remove**(collectionId: string, authKitId: string) → `Promise<void>`
8319
- Upsert contact identity after lightweight verification (public).
8319
+ Update the authenticated user's profile and replace the bearer token when refreshed claims are returned.
8320
8320
 
8321
8321
  ### batch
8322
8322
 
@@ -197,6 +197,8 @@ const session = await authKit.exchangeWhatsAppSession(clientId, wa.token, wa.ses
197
197
 
198
198
  `sessionKey` is returned by `sendWhatsApp` and is used to mitigate token replay from contexts that did not initiate the browser flow.
199
199
 
200
+ When `contactData.name` or explicit name parts were supplied on the original `sendWhatsApp` call, `session.user.displayName` and the returned bearer token claims are now seeded from the verified contact record instead of staying `null`.
201
+
200
202
  > **Note:** `redirectUrl` is optional. WhatsApp tokens are short hex strings (16 chars) for better UX.
201
203
  >
202
204
  > **Legacy note:** `verifyWhatsApp` is for older phone-bound token flows. Prefer inbound WhatsApp token confirmation plus status polling for new implementations.
@@ -219,7 +221,13 @@ import { authKit } from '@proveanything/smartlinks';
219
221
  const profile = await authKit.getProfile(clientId);
220
222
 
221
223
  // Update profile
222
- await authKit.updateProfile(clientId, { displayName: 'Alice B.', avatarUrl: '...' });
224
+ const updatedProfile = await authKit.updateProfile(clientId, {
225
+ displayName: 'Alice B.',
226
+ avatarUrl: '...'
227
+ });
228
+
229
+ // The SDK automatically swaps in updatedProfile.token so future auth.verify()
230
+ // and authenticated calls use fresh displayName/photoURL claims immediately.
223
231
 
224
232
  // Change password
225
233
  await authKit.changePassword(clientId, 'currentPass', 'newPass');
@@ -231,6 +239,8 @@ await authKit.changeEmail(clientId, 'newemail@example.com', 'password', redirect
231
239
  await authKit.deleteAccount(clientId, 'password', 'DELETE');
232
240
  ```
233
241
 
242
+ `updateProfile` now returns a fresh bearer token together with the updated profile fields. The SDK replaces the in-memory bearer token automatically so token-backed identity reads stay current without an extra refresh step.
243
+
234
244
  ---
235
245
 
236
246
  ## Email verification
package/dist/openapi.yaml CHANGED
@@ -8016,7 +8016,7 @@ paths:
8016
8016
  post:
8017
8017
  tags:
8018
8018
  - authKit
8019
- summary: authKit.updateProfile
8019
+ summary: "Update the authenticated user's profile and replace the bearer token when refreshed claims are returned."
8020
8020
  operationId: authKit_updateProfile
8021
8021
  security: []
8022
8022
  parameters:
@@ -8031,7 +8031,7 @@ paths:
8031
8031
  content:
8032
8032
  application/json:
8033
8033
  schema:
8034
- $ref: "#/components/schemas/UserProfile"
8034
+ $ref: "#/components/schemas/UpdateProfileResponse"
8035
8035
  400:
8036
8036
  description: Bad request
8037
8037
  401:
@@ -17756,6 +17756,13 @@ components:
17756
17756
  accountData:
17757
17757
  type: object
17758
17758
  additionalProperties: true
17759
+ UpdateProfileResponse:
17760
+ type: object
17761
+ properties:
17762
+ token:
17763
+ type: string
17764
+ required:
17765
+ - token
17759
17766
  SuccessResponse:
17760
17767
  type: object
17761
17768
  properties:
@@ -21,6 +21,9 @@ export interface ProfileUpdateData {
21
21
  photoURL?: string;
22
22
  accountData?: Record<string, any>;
23
23
  }
24
+ export interface UpdateProfileResponse extends UserProfile {
25
+ token: string;
26
+ }
24
27
  export interface SuccessResponse {
25
28
  success: boolean;
26
29
  message?: string;
@@ -1,6 +1,6 @@
1
1
  # Smartlinks API Summary
2
2
 
3
- Version: 1.13.16 | Generated: 2026-05-15T19:36:34.712Z
3
+ Version: 1.13.17 | Generated: 2026-05-15T20:47:03.471Z
4
4
 
5
5
  This is a concise summary of all available API functions and types.
6
6
 
@@ -8282,41 +8282,41 @@ Upsert contact identity after lightweight verification (public).
8282
8282
  **getProfile**(clientId: string) → `Promise<UserProfile>`
8283
8283
  Upsert contact identity after lightweight verification (public).
8284
8284
 
8285
- **updateProfile**(clientId: string, data: ProfileUpdateData) → `Promise<UserProfile>`
8286
- Upsert contact identity after lightweight verification (public).
8285
+ **updateProfile**(clientId: string, data: ProfileUpdateData) → `Promise<UpdateProfileResponse>`
8286
+ Update the authenticated user's profile and replace the bearer token when refreshed claims are returned.
8287
8287
 
8288
8288
  **changePassword**(clientId: string, currentPassword: string, newPassword: string) → `Promise<SuccessResponse>`
8289
- Upsert contact identity after lightweight verification (public).
8289
+ Update the authenticated user's profile and replace the bearer token when refreshed claims are returned.
8290
8290
 
8291
8291
  **changeEmail**(clientId: string, newEmail: string, password: string, redirectUrl: string) → `Promise<SuccessResponse>`
8292
- Upsert contact identity after lightweight verification (public).
8292
+ Update the authenticated user's profile and replace the bearer token when refreshed claims are returned.
8293
8293
 
8294
8294
  **verifyEmailChange**(clientId: string, token: string) → `Promise<SuccessResponse>`
8295
- Upsert contact identity after lightweight verification (public).
8295
+ Update the authenticated user's profile and replace the bearer token when refreshed claims are returned.
8296
8296
 
8297
8297
  **updatePhone**(clientId: string, phoneNumber: string, verificationCode: string) → `Promise<SuccessResponse>`
8298
- Upsert contact identity after lightweight verification (public).
8298
+ Update the authenticated user's profile and replace the bearer token when refreshed claims are returned.
8299
8299
 
8300
8300
  **deleteAccount**(clientId: string, password: string, confirmText: string) → `Promise<SuccessResponse>`
8301
- Upsert contact identity after lightweight verification (public).
8301
+ Update the authenticated user's profile and replace the bearer token when refreshed claims are returned.
8302
8302
 
8303
8303
  **load**(authKitId: string) → `Promise<AuthKitConfig>`
8304
- Upsert contact identity after lightweight verification (public).
8304
+ Update the authenticated user's profile and replace the bearer token when refreshed claims are returned.
8305
8305
 
8306
8306
  **get**(collectionId: string, authKitId: string) → `Promise<AuthKitConfig>`
8307
- Upsert contact identity after lightweight verification (public).
8307
+ Update the authenticated user's profile and replace the bearer token when refreshed claims are returned.
8308
8308
 
8309
8309
  **list**(collectionId: string, admin?: boolean) → `Promise<AuthKitConfig[]>`
8310
- Upsert contact identity after lightweight verification (public).
8310
+ Update the authenticated user's profile and replace the bearer token when refreshed claims are returned.
8311
8311
 
8312
8312
  **create**(collectionId: string, data: any) → `Promise<AuthKitConfig>`
8313
- Upsert contact identity after lightweight verification (public).
8313
+ Update the authenticated user's profile and replace the bearer token when refreshed claims are returned.
8314
8314
 
8315
8315
  **update**(collectionId: string, authKitId: string, data: any) → `Promise<AuthKitConfig>`
8316
- Upsert contact identity after lightweight verification (public).
8316
+ Update the authenticated user's profile and replace the bearer token when refreshed claims are returned.
8317
8317
 
8318
8318
  **remove**(collectionId: string, authKitId: string) → `Promise<void>`
8319
- Upsert contact identity after lightweight verification (public).
8319
+ Update the authenticated user's profile and replace the bearer token when refreshed claims are returned.
8320
8320
 
8321
8321
  ### batch
8322
8322
 
package/docs/auth-kit.md CHANGED
@@ -197,6 +197,8 @@ const session = await authKit.exchangeWhatsAppSession(clientId, wa.token, wa.ses
197
197
 
198
198
  `sessionKey` is returned by `sendWhatsApp` and is used to mitigate token replay from contexts that did not initiate the browser flow.
199
199
 
200
+ When `contactData.name` or explicit name parts were supplied on the original `sendWhatsApp` call, `session.user.displayName` and the returned bearer token claims are now seeded from the verified contact record instead of staying `null`.
201
+
200
202
  > **Note:** `redirectUrl` is optional. WhatsApp tokens are short hex strings (16 chars) for better UX.
201
203
  >
202
204
  > **Legacy note:** `verifyWhatsApp` is for older phone-bound token flows. Prefer inbound WhatsApp token confirmation plus status polling for new implementations.
@@ -219,7 +221,13 @@ import { authKit } from '@proveanything/smartlinks';
219
221
  const profile = await authKit.getProfile(clientId);
220
222
 
221
223
  // Update profile
222
- await authKit.updateProfile(clientId, { displayName: 'Alice B.', avatarUrl: '...' });
224
+ const updatedProfile = await authKit.updateProfile(clientId, {
225
+ displayName: 'Alice B.',
226
+ avatarUrl: '...'
227
+ });
228
+
229
+ // The SDK automatically swaps in updatedProfile.token so future auth.verify()
230
+ // and authenticated calls use fresh displayName/photoURL claims immediately.
223
231
 
224
232
  // Change password
225
233
  await authKit.changePassword(clientId, 'currentPass', 'newPass');
@@ -231,6 +239,8 @@ await authKit.changeEmail(clientId, 'newemail@example.com', 'password', redirect
231
239
  await authKit.deleteAccount(clientId, 'password', 'DELETE');
232
240
  ```
233
241
 
242
+ `updateProfile` now returns a fresh bearer token together with the updated profile fields. The SDK replaces the in-memory bearer token automatically so token-backed identity reads stay current without an extra refresh step.
243
+
234
244
  ---
235
245
 
236
246
  ## Email verification
package/openapi.yaml CHANGED
@@ -8016,7 +8016,7 @@ paths:
8016
8016
  post:
8017
8017
  tags:
8018
8018
  - authKit
8019
- summary: authKit.updateProfile
8019
+ summary: "Update the authenticated user's profile and replace the bearer token when refreshed claims are returned."
8020
8020
  operationId: authKit_updateProfile
8021
8021
  security: []
8022
8022
  parameters:
@@ -8031,7 +8031,7 @@ paths:
8031
8031
  content:
8032
8032
  application/json:
8033
8033
  schema:
8034
- $ref: "#/components/schemas/UserProfile"
8034
+ $ref: "#/components/schemas/UpdateProfileResponse"
8035
8035
  400:
8036
8036
  description: Bad request
8037
8037
  401:
@@ -17756,6 +17756,13 @@ components:
17756
17756
  accountData:
17757
17757
  type: object
17758
17758
  additionalProperties: true
17759
+ UpdateProfileResponse:
17760
+ type: object
17761
+ properties:
17762
+ token:
17763
+ type: string
17764
+ required:
17765
+ - token
17759
17766
  SuccessResponse:
17760
17767
  type: object
17761
17768
  properties:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@proveanything/smartlinks",
3
- "version": "1.13.16",
3
+ "version": "1.13.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",