cryptique-sdk 1.2.6 → 1.2.8
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/lib/cjs/index.js +12 -3
- package/lib/esm/index.js +12 -3
- package/lib/umd/index.js +12 -3
- package/package.json +1 -1
package/lib/cjs/index.js
CHANGED
|
@@ -4534,9 +4534,12 @@ if (window.Cryptique && window.Cryptique.initialized) ; else {
|
|
|
4534
4534
|
const transformedData = DataTransformer.toBackendFormat(sessionDataToSend);
|
|
4535
4535
|
|
|
4536
4536
|
// Send to track endpoint
|
|
4537
|
+
// Use a more generous timeout for session tracking so requests are
|
|
4538
|
+
// very unlikely to be aborted under normal conditions.
|
|
4537
4539
|
await this.send(CONFIG.API.TRACK, { sessionData: transformedData }, {
|
|
4538
4540
|
transform: false, // Already transformed
|
|
4539
|
-
retries: 2
|
|
4541
|
+
retries: 2,
|
|
4542
|
+
timeout: 15000
|
|
4540
4543
|
});
|
|
4541
4544
|
} catch (error) {
|
|
4542
4545
|
console.error('❌ Error sending session data:', error);
|
|
@@ -5858,6 +5861,12 @@ if (window.Cryptique && window.Cryptique.initialized) ; else {
|
|
|
5858
5861
|
// Mark SDK as initialized
|
|
5859
5862
|
runtimeState.isInitialized = true;
|
|
5860
5863
|
|
|
5864
|
+
// Resolve ready promise only after we're initialized (so enableAutoEvents/setup don't see "not initialized")
|
|
5865
|
+
if (typeof _readyPromiseResolve === 'function') {
|
|
5866
|
+
_readyPromiseResolve();
|
|
5867
|
+
_readyPromiseResolve = null;
|
|
5868
|
+
}
|
|
5869
|
+
|
|
5861
5870
|
// Send initial session data (non-blocking)
|
|
5862
5871
|
this.sendInitialSessionData().catch(() => {
|
|
5863
5872
|
// Ignore errors, will retry in interval
|
|
@@ -5866,10 +5875,10 @@ if (window.Cryptique && window.Cryptique.initialized) ; else {
|
|
|
5866
5875
|
} catch (error) {
|
|
5867
5876
|
console.error('Error initializing Cryptique SDK:', error);
|
|
5868
5877
|
} finally {
|
|
5869
|
-
//
|
|
5878
|
+
// If init threw before setting isInitialized, resolve anyway so _waitForReady() callers don't hang
|
|
5870
5879
|
if (typeof _readyPromiseResolve === 'function') {
|
|
5871
5880
|
_readyPromiseResolve();
|
|
5872
|
-
_readyPromiseResolve = null;
|
|
5881
|
+
_readyPromiseResolve = null;
|
|
5873
5882
|
}
|
|
5874
5883
|
}
|
|
5875
5884
|
}
|
package/lib/esm/index.js
CHANGED
|
@@ -4532,9 +4532,12 @@ if (window.Cryptique && window.Cryptique.initialized) ; else {
|
|
|
4532
4532
|
const transformedData = DataTransformer.toBackendFormat(sessionDataToSend);
|
|
4533
4533
|
|
|
4534
4534
|
// Send to track endpoint
|
|
4535
|
+
// Use a more generous timeout for session tracking so requests are
|
|
4536
|
+
// very unlikely to be aborted under normal conditions.
|
|
4535
4537
|
await this.send(CONFIG.API.TRACK, { sessionData: transformedData }, {
|
|
4536
4538
|
transform: false, // Already transformed
|
|
4537
|
-
retries: 2
|
|
4539
|
+
retries: 2,
|
|
4540
|
+
timeout: 15000
|
|
4538
4541
|
});
|
|
4539
4542
|
} catch (error) {
|
|
4540
4543
|
console.error('❌ Error sending session data:', error);
|
|
@@ -5856,6 +5859,12 @@ if (window.Cryptique && window.Cryptique.initialized) ; else {
|
|
|
5856
5859
|
// Mark SDK as initialized
|
|
5857
5860
|
runtimeState.isInitialized = true;
|
|
5858
5861
|
|
|
5862
|
+
// Resolve ready promise only after we're initialized (so enableAutoEvents/setup don't see "not initialized")
|
|
5863
|
+
if (typeof _readyPromiseResolve === 'function') {
|
|
5864
|
+
_readyPromiseResolve();
|
|
5865
|
+
_readyPromiseResolve = null;
|
|
5866
|
+
}
|
|
5867
|
+
|
|
5859
5868
|
// Send initial session data (non-blocking)
|
|
5860
5869
|
this.sendInitialSessionData().catch(() => {
|
|
5861
5870
|
// Ignore errors, will retry in interval
|
|
@@ -5864,10 +5873,10 @@ if (window.Cryptique && window.Cryptique.initialized) ; else {
|
|
|
5864
5873
|
} catch (error) {
|
|
5865
5874
|
console.error('Error initializing Cryptique SDK:', error);
|
|
5866
5875
|
} finally {
|
|
5867
|
-
//
|
|
5876
|
+
// If init threw before setting isInitialized, resolve anyway so _waitForReady() callers don't hang
|
|
5868
5877
|
if (typeof _readyPromiseResolve === 'function') {
|
|
5869
5878
|
_readyPromiseResolve();
|
|
5870
|
-
_readyPromiseResolve = null;
|
|
5879
|
+
_readyPromiseResolve = null;
|
|
5871
5880
|
}
|
|
5872
5881
|
}
|
|
5873
5882
|
}
|
package/lib/umd/index.js
CHANGED
|
@@ -4538,9 +4538,12 @@
|
|
|
4538
4538
|
const transformedData = DataTransformer.toBackendFormat(sessionDataToSend);
|
|
4539
4539
|
|
|
4540
4540
|
// Send to track endpoint
|
|
4541
|
+
// Use a more generous timeout for session tracking so requests are
|
|
4542
|
+
// very unlikely to be aborted under normal conditions.
|
|
4541
4543
|
await this.send(CONFIG.API.TRACK, { sessionData: transformedData }, {
|
|
4542
4544
|
transform: false, // Already transformed
|
|
4543
|
-
retries: 2
|
|
4545
|
+
retries: 2,
|
|
4546
|
+
timeout: 15000
|
|
4544
4547
|
});
|
|
4545
4548
|
} catch (error) {
|
|
4546
4549
|
console.error('❌ Error sending session data:', error);
|
|
@@ -5862,6 +5865,12 @@
|
|
|
5862
5865
|
// Mark SDK as initialized
|
|
5863
5866
|
runtimeState.isInitialized = true;
|
|
5864
5867
|
|
|
5868
|
+
// Resolve ready promise only after we're initialized (so enableAutoEvents/setup don't see "not initialized")
|
|
5869
|
+
if (typeof _readyPromiseResolve === 'function') {
|
|
5870
|
+
_readyPromiseResolve();
|
|
5871
|
+
_readyPromiseResolve = null;
|
|
5872
|
+
}
|
|
5873
|
+
|
|
5865
5874
|
// Send initial session data (non-blocking)
|
|
5866
5875
|
this.sendInitialSessionData().catch(() => {
|
|
5867
5876
|
// Ignore errors, will retry in interval
|
|
@@ -5870,10 +5879,10 @@
|
|
|
5870
5879
|
} catch (error) {
|
|
5871
5880
|
console.error('Error initializing Cryptique SDK:', error);
|
|
5872
5881
|
} finally {
|
|
5873
|
-
//
|
|
5882
|
+
// If init threw before setting isInitialized, resolve anyway so _waitForReady() callers don't hang
|
|
5874
5883
|
if (typeof _readyPromiseResolve === 'function') {
|
|
5875
5884
|
_readyPromiseResolve();
|
|
5876
|
-
_readyPromiseResolve = null;
|
|
5885
|
+
_readyPromiseResolve = null;
|
|
5877
5886
|
}
|
|
5878
5887
|
}
|
|
5879
5888
|
}
|
package/package.json
CHANGED