@proveanything/smartlinks 1.3.12 → 1.3.13

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,6 +1,6 @@
1
1
  # Smartlinks API Summary
2
2
 
3
- Version: 1.3.12 | Generated: 2026-02-06T10:04:42.892Z
3
+ Version: 1.3.13 | Generated: 2026-02-06T10:11:24.240Z
4
4
 
5
5
  This is a concise summary of all available API functions and types.
6
6
 
@@ -218,32 +218,34 @@ export class IframeResponder {
218
218
  }
219
219
  // Build URL - respect the URL format from server (hash routing or not)
220
220
  const url = new URL(this.appUrl);
221
+ // Determine if this is a hash-routed app by checking if URL has a hash
222
+ const isHashRouted = url.hash.length > 0;
221
223
  // If there's an initialPath, append it appropriately
222
224
  if (this.options.initialPath) {
223
225
  const path = this.options.initialPath;
224
- // If URL has hash, append to hash (for hash-routed apps)
225
- if (url.hash) {
226
- // Remove trailing slash from hash, add path
227
- const cleanHash = url.hash.replace(/\/$/, '');
228
- const cleanPath = path.startsWith('/') ? path : '/' + path;
229
- url.hash = cleanHash + cleanPath;
226
+ const cleanPath = path.startsWith('/') ? path : '/' + path;
227
+ if (isHashRouted) {
228
+ // Hash routing - append to hash
229
+ const currentHash = url.hash.slice(1); // Remove leading #
230
+ const cleanHash = currentHash.replace(/\/$/, '');
231
+ url.hash = '#' + cleanHash + cleanPath;
230
232
  }
231
233
  else {
232
- // No hash, append to pathname (for path-routed apps)
233
- const cleanPath = path.startsWith('/') ? path : '/' + path;
234
+ // Path routing - append to pathname
234
235
  url.pathname = url.pathname.replace(/\/$/, '') + cleanPath;
235
236
  }
236
237
  }
237
- // Add query params (to hash if present, otherwise to search)
238
- if (url.hash && url.hash.includes('#')) {
239
- // Hash routing - add params after hash
240
- const hashParts = url.hash.split('?');
238
+ // Add query params
239
+ if (isHashRouted) {
240
+ // Hash routing - params go in the hash after ?
241
+ const hashParts = url.hash.slice(1).split('?'); // Remove # and split
242
+ const hashPath = hashParts[0];
241
243
  const existingParams = hashParts[1] ? new URLSearchParams(hashParts[1]) : new URLSearchParams();
242
244
  params.forEach((value, key) => existingParams.set(key, value));
243
- url.hash = hashParts[0] + '?' + existingParams.toString();
245
+ url.hash = '#' + hashPath + '?' + existingParams.toString();
244
246
  }
245
247
  else {
246
- // Regular routing - add params to search
248
+ // Path routing - params go in searchParams
247
249
  params.forEach((value, key) => url.searchParams.set(key, value));
248
250
  }
249
251
  const finalUrl = url.toString();
@@ -1,6 +1,6 @@
1
1
  # Smartlinks API Summary
2
2
 
3
- Version: 1.3.12 | Generated: 2026-02-06T10:04:42.892Z
3
+ Version: 1.3.13 | Generated: 2026-02-06T10:11:24.240Z
4
4
 
5
5
  This is a concise summary of all available API functions and types.
6
6
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@proveanything/smartlinks",
3
- "version": "1.3.12",
3
+ "version": "1.3.13",
4
4
  "description": "Official JavaScript/TypeScript SDK for the Smartlinks API",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",