@echoteam/signoz-react 1.0.7 → 1.0.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/README.md +8 -6
- package/dist/index.esm.js +1 -5
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +1 -5
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -44,7 +44,8 @@ REACT_APP_SIGNOZ_ALLOWED_ORIGINS=https://api1.example.com,https://api2.example.c
|
|
|
44
44
|
> **Catatan untuk REACT_APP_SIGNOZ_ALLOWED_ORIGINS:**
|
|
45
45
|
> - Daftar URL yang diizinkan untuk CORS, dipisahkan dengan koma
|
|
46
46
|
> - Untuk RegExp pattern, gunakan format `/pattern/` (contoh: `/^https:\/\/.*\.example\.com$/`)
|
|
47
|
-
> -
|
|
47
|
+
> - Gunakan '*' untuk mengizinkan semua origin
|
|
48
|
+
> - Jika tidak diisi, default ke '*' (mengizinkan semua origin)
|
|
48
49
|
> - Spasi di sekitar koma akan dihapus otomatis
|
|
49
50
|
|
|
50
51
|
### Inisialisasi
|
|
@@ -83,7 +84,8 @@ initializeSignOzTracing({
|
|
|
83
84
|
},
|
|
84
85
|
allowedOrigins: [
|
|
85
86
|
'https://api.example.com',
|
|
86
|
-
/^https:\/\/.*\.your-domain\.com
|
|
87
|
+
/^https:\/\/.*\.your-domain\.com$/,
|
|
88
|
+
'*' // Mengizinkan semua origin (default)
|
|
87
89
|
]
|
|
88
90
|
});
|
|
89
91
|
```
|
|
@@ -110,9 +112,9 @@ function App() {
|
|
|
110
112
|
import { ErrorBoundary, ErrorBoundaryProps } from '@echoteam/signoz-react';
|
|
111
113
|
|
|
112
114
|
// Custom fallback component
|
|
113
|
-
const CustomErrorFallback: React.FC<{ error: Error; resetErrorBoundary: () => void }> = ({
|
|
114
|
-
error,
|
|
115
|
-
resetErrorBoundary
|
|
115
|
+
const CustomErrorFallback: React.FC<{ error: Error; resetErrorBoundary: () => void }> = ({
|
|
116
|
+
error,
|
|
117
|
+
resetErrorBoundary
|
|
116
118
|
}) => (
|
|
117
119
|
<div className="custom-error">
|
|
118
120
|
<h2>Terjadi Kesalahan!</h2>
|
|
@@ -239,7 +241,7 @@ Inisialisasi SignOz tracing untuk aplikasi React.
|
|
|
239
241
|
- `maxQueueSize`: Ukuran maksimum antrian span
|
|
240
242
|
- `scheduledDelayMillis`: Delay pengiriman batch dalam milidetik
|
|
241
243
|
- `exportTimeoutMillis`: Timeout ekspor dalam milidetik
|
|
242
|
-
- `allowedOrigins` (
|
|
244
|
+
- `allowedOrigins` (wajib): Array URL/RegExp yang diizinkan untuk CORS. Gunakan ['*'] untuk mengizinkan semua origin
|
|
243
245
|
|
|
244
246
|
### `ErrorBoundary`
|
|
245
247
|
|
package/dist/index.esm.js
CHANGED
|
@@ -15263,17 +15263,13 @@ function getConfigValue(key) {
|
|
|
15263
15263
|
}
|
|
15264
15264
|
// Fungsi untuk memvalidasi konfigurasi
|
|
15265
15265
|
function validateConfig(config) {
|
|
15266
|
-
const requiredFields = ['serviceName', 'serviceVersion', 'environment', 'serviceNamespace', 'url'
|
|
15266
|
+
const requiredFields = ['serviceName', 'serviceVersion', 'environment', 'serviceNamespace', 'url'];
|
|
15267
15267
|
const missingFields = [];
|
|
15268
15268
|
for (const field of requiredFields) {
|
|
15269
15269
|
if (!config[field]) {
|
|
15270
15270
|
missingFields.push(field);
|
|
15271
15271
|
}
|
|
15272
15272
|
}
|
|
15273
|
-
// Khusus validasi allowedOrigins: pastikan array tidak kosong
|
|
15274
|
-
if (config.allowedOrigins && config.allowedOrigins.length === 0) {
|
|
15275
|
-
missingFields.push('allowedOrigins tidak boleh kosong demi keamanan CORS');
|
|
15276
|
-
}
|
|
15277
15273
|
return {
|
|
15278
15274
|
isValid: missingFields.length === 0,
|
|
15279
15275
|
missingFields
|