sunuid-sdk 1.0.57 → 1.0.58

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.
@@ -81,3 +81,7 @@ DEBUG=false
81
81
  # SUNUID_MAX_REQUESTS=100
82
82
  # SUNUID_RATE_LIMIT=5
83
83
 
84
+
85
+
86
+
87
+
@@ -152,3 +152,7 @@ try {
152
152
  ]);
153
153
  }
154
154
  ?>
155
+
156
+
157
+
158
+
@@ -0,0 +1,117 @@
1
+ <!DOCTYPE html>
2
+ <html lang="fr">
3
+ <head>
4
+ <meta charset="UTF-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
+ <title>Test SunuID SDK</title>
7
+ <style>
8
+ body {
9
+ font-family: Arial, sans-serif;
10
+ max-width: 600px;
11
+ margin: 20px auto;
12
+ padding: 20px;
13
+ }
14
+ .qr-area {
15
+ border: 2px dashed #ccc;
16
+ padding: 40px;
17
+ text-align: center;
18
+ margin: 20px 0;
19
+ border-radius: 10px;
20
+ background-color: #f8f9fa;
21
+ }
22
+ .results {
23
+ background-color: #e8f5e8;
24
+ border: 1px solid #28a745;
25
+ border-radius: 5px;
26
+ padding: 15px;
27
+ margin: 20px 0;
28
+ }
29
+ #user-data {
30
+ background-color: #f8f9fa;
31
+ border: 1px solid #dee2e6;
32
+ border-radius: 3px;
33
+ padding: 10px;
34
+ margin: 5px 0;
35
+ white-space: pre-wrap;
36
+ font-size: 11px;
37
+ max-height: 150px;
38
+ overflow-y: auto;
39
+ }
40
+ .logs {
41
+ background-color: #f8f9fa;
42
+ border: 1px solid #dee2e6;
43
+ border-radius: 5px;
44
+ padding: 15px;
45
+ margin: 20px 0;
46
+ max-height: 200px;
47
+ overflow-y: auto;
48
+ font-family: monospace;
49
+ font-size: 12px;
50
+ }
51
+ </style>
52
+ </head>
53
+ <body>
54
+ <h1>🧪 Test SunuID SDK</h1>
55
+
56
+ <div class="qr-area" id="qr-area">
57
+ Génération du QR Code...
58
+ </div>
59
+
60
+ <div class="results">
61
+ <strong>Données utilisateur:</strong>
62
+ <pre id="user-data">-</pre>
63
+ </div>
64
+
65
+ <div class="logs" id="logs"></div>
66
+ <!-- Socket.IO (requis) -->
67
+ <script src="https://cdn.socket.io/4.7.4/socket.io.min.js"></script>
68
+ <script src="https://unpkg.com/sunuid-sdk@1.0.57/dist/sunuid-sdk.min.js"></script>
69
+
70
+ <script>
71
+ function log(message) {
72
+ const logsDiv = document.getElementById('logs');
73
+ const timestamp = new Date().toLocaleTimeString();
74
+ logsDiv.innerHTML += `[${timestamp}] ${message}<br>`;
75
+ logsDiv.scrollTop = logsDiv.scrollHeight;
76
+ }
77
+
78
+ const config = {
79
+ clientId: '1754670914_A908AC4CA011F0C9',
80
+ secretId: '99710a0f318d695e8c96f10c4a55fad28ec3963c2ddada35737951bcb3c66d9b',
81
+ type: 2,
82
+ partnerName: 'MonApplication',
83
+ enableSecurityLogs: true,
84
+ validateInputs: true,
85
+
86
+ onSuccess: function(authData) {
87
+ log('🎉 Authentification réussie!');
88
+ document.getElementById('user-data').textContent = JSON.stringify(authData, null, 2);
89
+ },
90
+
91
+ onError: function(error) {
92
+ log(`❌ Erreur: ${error}`);
93
+ },
94
+
95
+ onStatusUpdate: function(data) {
96
+ log(`📊 Statut: ${data.status || 'inconnu'}`);
97
+ }
98
+ };
99
+
100
+ async function initSunuID() {
101
+ try {
102
+ log('🚀 Initialisation...');
103
+ const sunuid = new SunuID(config);
104
+ await sunuid.init();
105
+ log('✅ SDK initialisé');
106
+ await sunuid.generateQR('qr-area');
107
+ log('✅ QR Code généré');
108
+ } catch (e) {
109
+ log(`❌ Erreur: ${e.message}`);
110
+ console.error('Init error:', e);
111
+ }
112
+ }
113
+
114
+ document.addEventListener('DOMContentLoaded', initSunuID);
115
+ </script>
116
+ </body>
117
+ </html>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sunuid-sdk",
3
- "version": "1.0.57",
3
+ "version": "1.0.58",
4
4
  "type": "module",
5
5
  "description": "SDK JavaScript sécurisé pour l'intégration des QR codes d'authentification et KYC SunuID",
6
6
  "main": "dist/sunuid-sdk.js",