Adopture Docs
SDKsFlutter

Configuration

Configure the Adopture Flutter SDK for your app.

The SDK works out of the box with sensible defaults. You can customize its behavior by passing options to Adopture.init().

Full Configuration

await Adopture.init(
  appKey: 'ak_your_app_key_here',  // Required
  debug: false,           // Enable debug logging
  autoCapture: true,      // Auto-track sessions and lifecycle
  flushInterval: Duration(seconds: 30),  // How often to send events
  flushAt: 20,            // Send when this many events queued
  maxQueueSize: 1000,     // Max events stored locally
  hashUserIds: true,      // SHA256 hash user IDs before sending
);

Options Reference

OptionTypeDefaultDescription
appKeyStringrequiredYour app key from the dashboard (format: ak_ + 24 characters)
debugboolfalseEnables debug logging and immediate event sending
autoCapturebooltrueAutomatically tracks session_start and lifecycle events
flushIntervalDuration30 secondsHow often queued events are sent to the server
flushAtint20Flush when this many events are queued (1--100)
maxQueueSizeint1000Maximum events stored in the local database
hashUserIdsbooltrueHash user IDs with SHA256 before transmission

Debug Mode

When debug is enabled:

  • Events are sent immediately instead of being batched
  • All SDK activity is logged to the console with the [Adopture] prefix
  • Useful during development to verify events are being tracked correctly
await Adopture.init(
  appKey: 'ak_your_app_key_here',
  debug: true,
);

Turn off debug mode before releasing your app to production. Immediate event sending increases network usage and may trigger rate limits during heavy use.

API Endpoint

The API endpoint is fixed to https://api.adopture.com and cannot be changed. All events are sent over HTTPS.

On this page