@proveanything/smartlinks 1.6.3 → 1.6.4

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.
@@ -98,6 +98,11 @@ export declare namespace auth {
98
98
  * Throws a `SmartlinksApiError` with `statusCode 401` and
99
99
  * `details.local = true` so callers can distinguish "never authenticated"
100
100
  * from an actual server-side token rejection.
101
+ *
102
+ * This short-circuit is skipped when proxy mode is enabled, because in that
103
+ * case credentials are held by the parent frame and the local SDK may have
104
+ * no token set yet — the request must be forwarded to the parent to determine
105
+ * whether the user is authenticated.
101
106
  */
102
107
  function getAccount(): Promise<AccountInfoResponse>;
103
108
  }
package/dist/api/auth.js CHANGED
@@ -1,4 +1,4 @@
1
- import { post, request, setBearerToken, getApiHeaders, hasAuthCredentials } from "../http";
1
+ import { post, request, setBearerToken, getApiHeaders, hasAuthCredentials, isProxyEnabled } from "../http";
2
2
  import { SmartlinksApiError } from "../types/error";
3
3
  /*
4
4
  user: Record<string, any>
@@ -91,9 +91,14 @@ export var auth;
91
91
  * Throws a `SmartlinksApiError` with `statusCode 401` and
92
92
  * `details.local = true` so callers can distinguish "never authenticated"
93
93
  * from an actual server-side token rejection.
94
+ *
95
+ * This short-circuit is skipped when proxy mode is enabled, because in that
96
+ * case credentials are held by the parent frame and the local SDK may have
97
+ * no token set yet — the request must be forwarded to the parent to determine
98
+ * whether the user is authenticated.
94
99
  */
95
100
  async function getAccount() {
96
- if (!hasAuthCredentials()) {
101
+ if (!hasAuthCredentials() && !isProxyEnabled()) {
97
102
  throw new SmartlinksApiError('Not authenticated: no bearer token or API key is set.', 401, { code: 401, errorCode: 'NOT_AUTHENTICATED', message: 'Not authenticated: no bearer token or API key is set.', details: { local: true } });
98
103
  }
99
104
  return request("/public/auth/account");
@@ -1,6 +1,6 @@
1
1
  # Smartlinks API Summary
2
2
 
3
- Version: 1.6.3 | Generated: 2026-02-26T11:49:31.908Z
3
+ Version: 1.6.4 | Generated: 2026-02-26T12:33:27.813Z
4
4
 
5
5
  This is a concise summary of all available API functions and types.
6
6
 
@@ -4987,7 +4987,7 @@ Tries to register a new user account. Can return a bearer token, or a Firebase t
4987
4987
  Admin: Get a user bearer token (impersonation/automation). POST /admin/auth/userToken All fields are optional; at least one identifier should be provided.
4988
4988
 
4989
4989
  **getAccount**() → `Promise<AccountInfoResponse>`
4990
- Gets current account information for the logged in user. Returns user, owner, account, and location objects. Short-circuits immediately (no network request) when the SDK has no bearer token or API key set — the server would return 401 anyway. Throws a `SmartlinksApiError` with `statusCode 401` and `details.local = true` so callers can distinguish "never authenticated" from an actual server-side token rejection.
4990
+ Gets current account information for the logged in user. Returns user, owner, account, and location objects. Short-circuits immediately (no network request) when the SDK has no bearer token or API key set — the server would return 401 anyway. Throws a `SmartlinksApiError` with `statusCode 401` and `details.local = true` so callers can distinguish "never authenticated" from an actual server-side token rejection. This short-circuit is skipped when proxy mode is enabled, because in that case credentials are held by the parent frame and the local SDK may have no token set yet — the request must be forwarded to the parent to determine whether the user is authenticated.
4991
4991
 
4992
4992
  ### authKit
4993
4993
 
@@ -1,6 +1,6 @@
1
1
  # Smartlinks API Summary
2
2
 
3
- Version: 1.6.3 | Generated: 2026-02-26T11:49:31.908Z
3
+ Version: 1.6.4 | Generated: 2026-02-26T12:33:27.813Z
4
4
 
5
5
  This is a concise summary of all available API functions and types.
6
6
 
@@ -4987,7 +4987,7 @@ Tries to register a new user account. Can return a bearer token, or a Firebase t
4987
4987
  Admin: Get a user bearer token (impersonation/automation). POST /admin/auth/userToken All fields are optional; at least one identifier should be provided.
4988
4988
 
4989
4989
  **getAccount**() → `Promise<AccountInfoResponse>`
4990
- Gets current account information for the logged in user. Returns user, owner, account, and location objects. Short-circuits immediately (no network request) when the SDK has no bearer token or API key set — the server would return 401 anyway. Throws a `SmartlinksApiError` with `statusCode 401` and `details.local = true` so callers can distinguish "never authenticated" from an actual server-side token rejection.
4990
+ Gets current account information for the logged in user. Returns user, owner, account, and location objects. Short-circuits immediately (no network request) when the SDK has no bearer token or API key set — the server would return 401 anyway. Throws a `SmartlinksApiError` with `statusCode 401` and `details.local = true` so callers can distinguish "never authenticated" from an actual server-side token rejection. This short-circuit is skipped when proxy mode is enabled, because in that case credentials are held by the parent frame and the local SDK may have no token set yet — the request must be forwarded to the parent to determine whether the user is authenticated.
4991
4991
 
4992
4992
  ### authKit
4993
4993
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@proveanything/smartlinks",
3
- "version": "1.6.3",
3
+ "version": "1.6.4",
4
4
  "description": "Official JavaScript/TypeScript SDK for the Smartlinks API",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",