@lumiapassport/ui-kit 1.4.7 → 1.4.9
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/iframe/index.html +1 -1
- package/dist/iframe/main.js +9 -1
- package/dist/iframe/main.js.map +1 -1
- package/dist/index.cjs +62 -15
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +58 -11
- package/dist/index.js.map +1 -1
- package/package.json +3 -2
package/dist/index.js
CHANGED
|
@@ -750,6 +750,7 @@ var init_passkey = __esm({
|
|
|
750
750
|
});
|
|
751
751
|
|
|
752
752
|
// src/internal/lib/iframe-mpc-client.ts
|
|
753
|
+
import { logSdkError } from "@lumiapassport/core/internal/error-tracking";
|
|
753
754
|
async function ensureDkgAndGetOwner(userId, _clientSeedHex) {
|
|
754
755
|
try {
|
|
755
756
|
const iframeManager = getIframeManager();
|
|
@@ -772,7 +773,11 @@ async function ensureDkgAndGetOwner(userId, _clientSeedHex) {
|
|
|
772
773
|
ownerAddress
|
|
773
774
|
};
|
|
774
775
|
} catch (error) {
|
|
775
|
-
|
|
776
|
+
logSdkError(
|
|
777
|
+
error instanceof Error ? error : new Error("DKG failed"),
|
|
778
|
+
{ userId },
|
|
779
|
+
"iframe-mpc"
|
|
780
|
+
);
|
|
776
781
|
throw error;
|
|
777
782
|
}
|
|
778
783
|
}
|
|
@@ -804,7 +809,11 @@ async function signDigestWithMpc(userId, digest32, userOpDetails) {
|
|
|
804
809
|
currentSigningStats.totalDurationMs = endTime - startTime;
|
|
805
810
|
return signature;
|
|
806
811
|
} catch (error) {
|
|
807
|
-
|
|
812
|
+
logSdkError(
|
|
813
|
+
error instanceof Error ? error : new Error("MPC signing failed"),
|
|
814
|
+
{ userId, hasUserOpDetails: !!userOpDetails },
|
|
815
|
+
"iframe-mpc"
|
|
816
|
+
);
|
|
808
817
|
const endTime = performance.now();
|
|
809
818
|
if (currentSigningStats) {
|
|
810
819
|
currentSigningStats.endTime = endTime;
|
|
@@ -831,6 +840,7 @@ var init_iframe_mpc_client = __esm({
|
|
|
831
840
|
});
|
|
832
841
|
|
|
833
842
|
// src/internal/clients/httpClient.ts
|
|
843
|
+
import { logSdkError as logSdkError2 } from "@lumiapassport/core/internal/error-tracking";
|
|
834
844
|
function createHttpClient(baseUrl) {
|
|
835
845
|
return new HttpClient(baseUrl);
|
|
836
846
|
}
|
|
@@ -891,7 +901,11 @@ var init_httpClient = __esm({
|
|
|
891
901
|
}
|
|
892
902
|
return await this.processResponse(response);
|
|
893
903
|
} catch (error) {
|
|
894
|
-
|
|
904
|
+
logSdkError2(
|
|
905
|
+
error instanceof Error ? error : new Error("Network error"),
|
|
906
|
+
{ url, method },
|
|
907
|
+
"http-client"
|
|
908
|
+
);
|
|
895
909
|
return {
|
|
896
910
|
success: false,
|
|
897
911
|
error: error instanceof Error ? error.message : "Network error",
|
|
@@ -917,7 +931,11 @@ var init_httpClient = __esm({
|
|
|
917
931
|
status
|
|
918
932
|
};
|
|
919
933
|
} catch (parseError) {
|
|
920
|
-
|
|
934
|
+
logSdkError2(
|
|
935
|
+
parseError instanceof Error ? parseError : new Error("Failed to parse response"),
|
|
936
|
+
{ status },
|
|
937
|
+
"http-client"
|
|
938
|
+
);
|
|
921
939
|
return {
|
|
922
940
|
success: false,
|
|
923
941
|
error: "Invalid response format",
|
|
@@ -1196,6 +1214,7 @@ __export(vaultClient_exports, {
|
|
|
1196
1214
|
updateBackupStatus: () => updateBackupStatus,
|
|
1197
1215
|
uploadShare: () => uploadShare
|
|
1198
1216
|
});
|
|
1217
|
+
import { logSdkError as logSdkError3 } from "@lumiapassport/core/internal/error-tracking";
|
|
1199
1218
|
function getBackupEncryptionMethod(backupFile) {
|
|
1200
1219
|
if (backupFile.encryptionMethod) return backupFile.encryptionMethod;
|
|
1201
1220
|
return "unknown";
|
|
@@ -1306,7 +1325,11 @@ async function deriveKEKFromPasskey(userId, requiredCredentialId) {
|
|
|
1306
1325
|
const kekBytes = await crypto.subtle.deriveBits({ name: "HKDF", hash: "SHA-256", salt: challenge, info: new TextEncoder().encode("client-share") }, keyMaterial, 256);
|
|
1307
1326
|
return kekBytes;
|
|
1308
1327
|
} catch (error) {
|
|
1309
|
-
|
|
1328
|
+
logSdkError3(
|
|
1329
|
+
error instanceof Error ? error : new Error("Passkey operation failed"),
|
|
1330
|
+
{ userId },
|
|
1331
|
+
"vault"
|
|
1332
|
+
);
|
|
1310
1333
|
throw error;
|
|
1311
1334
|
}
|
|
1312
1335
|
}
|
|
@@ -1547,7 +1570,11 @@ async function envelopeDecryptKeyshare(envelope, userId) {
|
|
|
1547
1570
|
const result = JSON.parse(plaintext);
|
|
1548
1571
|
return result;
|
|
1549
1572
|
} catch (error) {
|
|
1550
|
-
|
|
1573
|
+
logSdkError3(
|
|
1574
|
+
error instanceof Error ? error : new Error("Envelope decryption failed"),
|
|
1575
|
+
{ hasCredentialId: !!envelope.credentialId },
|
|
1576
|
+
"vault"
|
|
1577
|
+
);
|
|
1551
1578
|
if (error instanceof Error && error.name === "OperationError") {
|
|
1552
1579
|
const credentialHint = envelope.credentialId ? `The backup requires a specific passkey (ID: ${envelope.credentialId.slice(-8)}...)` : "The backup was encrypted with a different passkey than the one you selected";
|
|
1553
1580
|
throw new Error(`Passkey mismatch: ${credentialHint}. If you have multiple passkeys, please try again and select the correct passkey that was used when creating this backup.`);
|
|
@@ -1572,7 +1599,11 @@ async function envelopeDecryptKeyshareWithPassword(envelope, password) {
|
|
|
1572
1599
|
const result = JSON.parse(plaintext);
|
|
1573
1600
|
return result;
|
|
1574
1601
|
} catch (error) {
|
|
1575
|
-
|
|
1602
|
+
logSdkError3(
|
|
1603
|
+
error instanceof Error ? error : new Error("Password decryption failed"),
|
|
1604
|
+
{ errorName: error instanceof Error ? error.name : "unknown" },
|
|
1605
|
+
"vault"
|
|
1606
|
+
);
|
|
1576
1607
|
if (error instanceof Error && error.name === "OperationError") {
|
|
1577
1608
|
throw new Error("Incorrect password: Unable to decrypt the backup with the provided password.");
|
|
1578
1609
|
}
|
|
@@ -1646,7 +1677,11 @@ function getCurrentKeyshareBackupData(userId) {
|
|
|
1646
1677
|
version: BACKUP_VERSION
|
|
1647
1678
|
};
|
|
1648
1679
|
} catch (error) {
|
|
1649
|
-
|
|
1680
|
+
logSdkError3(
|
|
1681
|
+
error instanceof Error ? error : new Error("Failed to get keyshare data"),
|
|
1682
|
+
{ userId },
|
|
1683
|
+
"vault"
|
|
1684
|
+
);
|
|
1650
1685
|
return null;
|
|
1651
1686
|
}
|
|
1652
1687
|
}
|
|
@@ -1728,9 +1763,12 @@ async function backupToCloud(userId, password, providerId, usePrivateStorage = t
|
|
|
1728
1763
|
console.info(`[BACKUP] Uploading backup to ${provider.name}`);
|
|
1729
1764
|
const fileId = await provider.upload(fileName, fileContent, usePrivateStorage);
|
|
1730
1765
|
updateBackupStatus(userId, "cloud", { enabled: true, lastBackup: timestamp, error: void 0 });
|
|
1731
|
-
console.info(`[BACKUP] Successfully uploaded backup to ${provider.name}, file ID: ${fileId}`);
|
|
1732
1766
|
} catch (error) {
|
|
1733
|
-
|
|
1767
|
+
logSdkError3(
|
|
1768
|
+
error instanceof Error ? error : new Error("Cloud backup failed"),
|
|
1769
|
+
{ userId, providerId },
|
|
1770
|
+
"vault"
|
|
1771
|
+
);
|
|
1734
1772
|
const errorMsg = error instanceof Error ? error.message : "Cloud backup failed";
|
|
1735
1773
|
updateBackupStatus(userId, "cloud", { error: errorMsg });
|
|
1736
1774
|
throw new Error(errorMsg);
|
|
@@ -2873,6 +2911,7 @@ var init_iframe_manager = __esm({
|
|
|
2873
2911
|
|
|
2874
2912
|
// src/context/LumiaPassportContext.tsx
|
|
2875
2913
|
import { createContext, useCallback, useContext, useEffect, useState } from "react";
|
|
2914
|
+
import { initSdkErrorTracking } from "@lumiapassport/core/internal/error-tracking";
|
|
2876
2915
|
import { jsx as jsx3 } from "react/jsx-runtime";
|
|
2877
2916
|
var LumiaPassportContext, LumiaPassportProvider, useLumiaPassportConfig;
|
|
2878
2917
|
var init_LumiaPassportContext = __esm({
|
|
@@ -2938,6 +2977,13 @@ var init_LumiaPassportContext = __esm({
|
|
|
2938
2977
|
}
|
|
2939
2978
|
} catch {
|
|
2940
2979
|
}
|
|
2980
|
+
try {
|
|
2981
|
+
initSdkErrorTracking();
|
|
2982
|
+
} catch (error) {
|
|
2983
|
+
if (process.env.NODE_ENV === "development") {
|
|
2984
|
+
console.warn("[LumiaPassport] Failed to initialize SDK error tracking:", error);
|
|
2985
|
+
}
|
|
2986
|
+
}
|
|
2941
2987
|
return merged;
|
|
2942
2988
|
});
|
|
2943
2989
|
const updateConfig = useCallback((updates) => {
|
|
@@ -8466,7 +8512,7 @@ function useLumiaPassportLinkedProfiles() {
|
|
|
8466
8512
|
// package.json
|
|
8467
8513
|
var package_default = {
|
|
8468
8514
|
name: "@lumiapassport/ui-kit",
|
|
8469
|
-
version: "1.4.
|
|
8515
|
+
version: "1.4.9",
|
|
8470
8516
|
description: "React UI components and hooks for Lumia Passport authentication and Account Abstraction",
|
|
8471
8517
|
type: "module",
|
|
8472
8518
|
main: "./dist/index.cjs",
|
|
@@ -8517,6 +8563,7 @@ var package_default = {
|
|
|
8517
8563
|
dependencies: {
|
|
8518
8564
|
"@lumiapassport/core": "workspace:*",
|
|
8519
8565
|
"@rainbow-me/rainbowkit": "^2.2.8",
|
|
8566
|
+
"@sentry/browser": "^10.22.0",
|
|
8520
8567
|
"lucide-react": "^0.454.0",
|
|
8521
8568
|
qrcode: "^1.5.0"
|
|
8522
8569
|
},
|