Options du SDK
Référence des options SnapLogs.init pour toutes les plateformes.
Options communes
| Option | Type | Défaut | Description |
|--------|------|--------|-------------|
| apiKey | string | — | Clé API du projet (obligatoire) |
| environment | string | production | Environnement (production, staging, development) |
| enabled | boolean | true | Active/désactive le SDK |
Capture
| Option | Type | Défaut | Description |
|--------|------|--------|-------------|
| screenshot.quality | number | 0.8 | Qualité JPEG 0–1 |
| screenshot.allowAnnotation | boolean | true | Annotations utilisateur |
| screenshot.privacyMask | string[] | [] | Sélecteurs CSS à masquer |
Breadcrumbs & réseau
| Option | Type | Défaut | Description |
|--------|------|--------|-------------|
| breadcrumbs.maxItems | number | 50 | Taille du buffer |
| network.captureBody | boolean | true | Capture des bodies |
| network.sanitizeKeys | string[] | auth keys | Clés masquées automatiquement |
Exemple
SnapLogs.init({
apiKey: 'sk_...',
environment: 'production',
screenshot: { quality: 0.8, allowAnnotation: true },
breadcrumbs: { maxItems: 50, trackClicks: true },
network: { captureBody: true, sanitizeKeys: ['Authorization', 'password'] },
});