Configuration
Complete reference for all EndpointVault configuration options.
Full Configuration Example
await EndpointVault.init(
// Required
apiKey: 'your-api-key',
encryptionKey: 'your-32-character-key',
// Server & Environment
serverUrl: 'https://api.endpoint.yahhi.me',
environment: 'production',
appVersion: '1.0.0',
// Capture Options
captureSuccessStats: true,
enableOfflineQueue: true,
maxOfflineQueueSize: 100,
debug: false,
// File Attachments
captureFileAttachments: true,
maxAttachmentFileSize: 52428800, // 50MB
maxTotalAttachmentSize: 104857600, // 100MB
maxAttachmentsPerEvent: 10,
attachmentRetentionDuration: Duration(days: 7),
// Redaction
redaction: RedactionConfig(
redactHeaders: ['authorization', 'x-api-key', 'cookie'],
redactBodyFields: ['password', 'token', 'credit_card'],
redactQueryParams: ['token', 'key', 'secret'],
redactAuthorizationHeader: true,
),
// Retry
retry: RetryConfig(
maxRetries: 3,
initialDelay: Duration(seconds: 1),
maxDelay: Duration(seconds: 30),
),
);
Init Options
| Option | Type | Default | Description |
|---|---|---|---|
apiKey | String | required | Your API key from the dashboard |
encryptionKey | String | required | 32-character encryption key |
serverUrl | String | hosted | Server URL (for self-hosting) |
environment | String | 'production' | Environment name |
appVersion | String? | null | App version for tracking |
captureSuccessStats | bool | true | Capture stats for successful requests |
enableOfflineQueue | bool | true | Queue events when offline |
maxOfflineQueueSize | int | 100 | Max queued events |
debug | bool | false | Enable console logging |
Interceptor Options
dio.interceptors.add(EndpointVaultInterceptor(
onlyCritical: false, // Only capture critical requests
captureSuccessStats: true, // Capture success metrics
captureFileAttachments: true, // Capture FormData files
shouldCapture: (req) => true, // Custom filter
isCritical: (req) => false, // Custom critical check
));
