@dream-api/sdk 0.1.18 → 0.1.20
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 +22 -1
- package/dist/index.mjs +22 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -214,13 +214,34 @@ var ClerkManager = class {
|
|
|
214
214
|
script.onerror = () => reject(new Error("Failed to load Clerk SDK"));
|
|
215
215
|
document.head.appendChild(script);
|
|
216
216
|
});
|
|
217
|
-
|
|
217
|
+
let clerk;
|
|
218
|
+
for (let i = 0; i < 50; i++) {
|
|
219
|
+
clerk = getClerk();
|
|
220
|
+
if (clerk) break;
|
|
221
|
+
await new Promise((r) => setTimeout(r, 100));
|
|
222
|
+
}
|
|
218
223
|
if (clerk) {
|
|
219
224
|
await clerk.load();
|
|
220
225
|
const urlParams = new URLSearchParams(window.location.search);
|
|
221
226
|
const ticket = urlParams.get("__clerk_ticket");
|
|
222
227
|
console.log("[DreamAPI] URL:", window.location.href);
|
|
223
228
|
console.log("[DreamAPI] Ticket present:", ticket ? "YES" : "NO");
|
|
229
|
+
const sdkDebug = {
|
|
230
|
+
timestamp: (/* @__PURE__ */ new Date()).toISOString(),
|
|
231
|
+
url: window.location.href,
|
|
232
|
+
hasTicket: !!ticket,
|
|
233
|
+
ticketLength: ticket ? ticket.length : 0,
|
|
234
|
+
signupDebug: localStorage.getItem("dream_signup_debug"),
|
|
235
|
+
signupRedirect: localStorage.getItem("dream_signup_redirect")
|
|
236
|
+
};
|
|
237
|
+
localStorage.setItem("dream_sdk_debug", JSON.stringify(sdkDebug));
|
|
238
|
+
if (ticket) {
|
|
239
|
+
for (let i = 0; i < 30; i++) {
|
|
240
|
+
if (clerk.signIn && clerk.setActive) break;
|
|
241
|
+
await new Promise((r) => setTimeout(r, 100));
|
|
242
|
+
}
|
|
243
|
+
console.log("[DreamAPI] signIn available:", !!clerk.signIn, "setActive:", !!clerk.setActive);
|
|
244
|
+
}
|
|
224
245
|
if (ticket && clerk.signIn && clerk.setActive) {
|
|
225
246
|
console.log("[DreamAPI] Consuming ticket...");
|
|
226
247
|
try {
|
package/dist/index.mjs
CHANGED
|
@@ -186,13 +186,34 @@ var ClerkManager = class {
|
|
|
186
186
|
script.onerror = () => reject(new Error("Failed to load Clerk SDK"));
|
|
187
187
|
document.head.appendChild(script);
|
|
188
188
|
});
|
|
189
|
-
|
|
189
|
+
let clerk;
|
|
190
|
+
for (let i = 0; i < 50; i++) {
|
|
191
|
+
clerk = getClerk();
|
|
192
|
+
if (clerk) break;
|
|
193
|
+
await new Promise((r) => setTimeout(r, 100));
|
|
194
|
+
}
|
|
190
195
|
if (clerk) {
|
|
191
196
|
await clerk.load();
|
|
192
197
|
const urlParams = new URLSearchParams(window.location.search);
|
|
193
198
|
const ticket = urlParams.get("__clerk_ticket");
|
|
194
199
|
console.log("[DreamAPI] URL:", window.location.href);
|
|
195
200
|
console.log("[DreamAPI] Ticket present:", ticket ? "YES" : "NO");
|
|
201
|
+
const sdkDebug = {
|
|
202
|
+
timestamp: (/* @__PURE__ */ new Date()).toISOString(),
|
|
203
|
+
url: window.location.href,
|
|
204
|
+
hasTicket: !!ticket,
|
|
205
|
+
ticketLength: ticket ? ticket.length : 0,
|
|
206
|
+
signupDebug: localStorage.getItem("dream_signup_debug"),
|
|
207
|
+
signupRedirect: localStorage.getItem("dream_signup_redirect")
|
|
208
|
+
};
|
|
209
|
+
localStorage.setItem("dream_sdk_debug", JSON.stringify(sdkDebug));
|
|
210
|
+
if (ticket) {
|
|
211
|
+
for (let i = 0; i < 30; i++) {
|
|
212
|
+
if (clerk.signIn && clerk.setActive) break;
|
|
213
|
+
await new Promise((r) => setTimeout(r, 100));
|
|
214
|
+
}
|
|
215
|
+
console.log("[DreamAPI] signIn available:", !!clerk.signIn, "setActive:", !!clerk.setActive);
|
|
216
|
+
}
|
|
196
217
|
if (ticket && clerk.signIn && clerk.setActive) {
|
|
197
218
|
console.log("[DreamAPI] Consuming ticket...");
|
|
198
219
|
try {
|