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
| Option | Type | Default | Description |
|---|---|---|---|
appKey | String | required | Your app key from the dashboard (format: ak_ + 24 characters) |
debug | bool | false | Enables debug logging and immediate event sending |
autoCapture | bool | true | Automatically tracks session_start and lifecycle events |
flushInterval | Duration | 30 seconds | How often queued events are sent to the server |
flushAt | int | 20 | Flush when this many events are queued (1--100) |
maxQueueSize | int | 1000 | Maximum events stored in the local database |
hashUserIds | bool | true | Hash 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.