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

OptionTypeDefaultDescription
apiKeyStringrequiredYour API key from the dashboard
encryptionKeyStringrequired32-character encryption key
serverUrlStringhostedServer URL (for self-hosting)
environmentString'production'Environment name
appVersionString?nullApp version for tracking
captureSuccessStatsbooltrueCapture stats for successful requests
enableOfflineQueuebooltrueQueue events when offline
maxOfflineQueueSizeint100Max queued events
debugboolfalseEnable 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
));