Getting Started
Get EndpointVault running in your Flutter app in under 10 minutes. You'll install the SDK, initialize it, and capture your first API failure.
Prerequisites
- Flutter 3.10.0 or later
- Dart 3.0.0 or later
- Dio HTTP client (^5.4.0)
- An EndpointVault account — sign up free
Installation
1
Add the dependency
Add EndpointVault to your pubspec.yaml:
dependencies:
endpoint_vault: ^0.1.0
dio: ^5.4.0
Then run:
flutter pub get
2
Initialize the SDK
Initialize EndpointVault in your main() function before runApp():
import 'package:endpoint_vault/endpoint_vault.dart';
import 'package:flutter/material.dart';
void main() async {
WidgetsFlutterBinding.ensureInitialized();
await EndpointVault.init(
apiKey: 'your-api-key', // From dashboard
encryptionKey: 'your-32-char-key', // Your encryption key
environment: 'production',
appVersion: '1.0.0',
// Optional: Handle server-triggered replays
onReplayRequest: (eventId, request) async {
// Re-execute the request and return the Response
final response = await dio.request(
request.url,
data: request.requestBody,
options: Options(method: request.method),
);
return response;
},
);
runApp(MyApp());
}
Tip: Get your API key from the EndpointVault dashboard after creating a project.
Generate a strong 32-character encryption key — only you will have it.
3
Add the Dio interceptor
Add the interceptor to your Dio instance to automatically capture failures:
final dio = Dio();
dio.interceptors.add(EndpointVaultInterceptor());
That's it!
By default, all failed requests are captured. When a request fails, EndpointVault will automatically:
- Redact sensitive fields (passwords, tokens, etc.)
- Encrypt the request/response data
- Send it to the server for storage
- Queue it locally if offline
View your captured events and endpoint statistics in the dashboard.
Next steps
- Configuration — Customize redaction, retry behavior, and more
- Critical Requests — Capture only selected failures
- File Attachments — Capture file uploads from FormData
- Encryption — Learn how encryption works
- Device-side Replay — Re-execute failed requests