@codetunezstudios/token-kit 0.1.0-beta.5 → 0.1.0-beta.6

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/dist/index.js CHANGED
@@ -219,7 +219,9 @@ var STORAGE_KEY = "tokenkit_user_token";
219
219
  async function connectViaPortal(options) {
220
220
  const portalUrl = (options.portalUrl ?? "https://ai-tokens.me").replace(/\/$/, "");
221
221
  const currentOrigin = encodeURIComponent(window.location.origin);
222
- const url = `${portalUrl}/connect?clientId=${encodeURIComponent(options.clientId)}&origin=${currentOrigin}`;
222
+ const existingToken = getStoredUserToken();
223
+ const reconnectParam = existingToken ? "&reconnect=true" : "";
224
+ const url = `${portalUrl}/connect?clientId=${encodeURIComponent(options.clientId)}&origin=${currentOrigin}${reconnectParam}`;
223
225
  const popup = window.open(
224
226
  url,
225
227
  "tokenkit-connect",
package/dist/index.mjs CHANGED
@@ -176,7 +176,9 @@ var STORAGE_KEY = "tokenkit_user_token";
176
176
  async function connectViaPortal(options) {
177
177
  const portalUrl = (options.portalUrl ?? "https://ai-tokens.me").replace(/\/$/, "");
178
178
  const currentOrigin = encodeURIComponent(window.location.origin);
179
- const url = `${portalUrl}/connect?clientId=${encodeURIComponent(options.clientId)}&origin=${currentOrigin}`;
179
+ const existingToken = getStoredUserToken();
180
+ const reconnectParam = existingToken ? "&reconnect=true" : "";
181
+ const url = `${portalUrl}/connect?clientId=${encodeURIComponent(options.clientId)}&origin=${currentOrigin}${reconnectParam}`;
180
182
  const popup = window.open(
181
183
  url,
182
184
  "tokenkit-connect",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@codetunezstudios/token-kit",
3
- "version": "0.1.0-beta.5",
3
+ "version": "0.1.0-beta.6",
4
4
  "description": "Official TypeScript SDK for token-kit - AI token infrastructure for developers",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",