EndpointVault

pub package License: MIT

Encrypted endpoint failure capture for Flutter apps.

Stop losing user data when API calls fail. EndpointVault captures critical failures with client-side encryption, tracks endpoint reliability, and enables request replay.

Quick Start

dependencies:
  endpoint_vault: ^0.1.0
import 'package:endpoint_vault/endpoint_vault.dart';

void main() async {
  WidgetsFlutterBinding.ensureInitialized();

  await EndpointVault.init(
    apiKey: 'your-api-key',
    encryptionKey: 'your-32-character-key',
  );

  runApp(MyApp());
}
final dio = Dio();
dio.interceptors.add(EndpointVaultInterceptor());

// Mark critical requests
await dio.post('/api/payment',
  data: paymentData,
  options: Options().critical(),
);

Features

  • Encrypted Capture — AES-256 client-side encryption
  • File Attachments — Capture FormData file uploads
  • Automatic Redaction — Strip passwords, tokens, PII
  • Offline Queue — Queue events when offline
  • Device-side Replay — Re-execute failed requests
  • Replay Callback — Your app stays in control of how requests are re-executed

Request Replay

When the server requests a replay of a captured failure, the SDK invokes the onReplayRequest callback you registered during initialization. Re-execute the request with your own Dio instance (so your normal interceptors and authentication apply) and return the response, or null if the replay failed:

await EndpointVault.init(
  apiKey: 'your-api-key',
  encryptionKey: 'your-32-character-key',
  onReplayRequest: (eventId, request) async {
    final response = await myAppDio.request(
      request.url,
      data: request.requestBody,
      options: Options(method: request.method),
    );

    // Continue any dependent workflow here (e.g. file uploads)
    return response;
  },
);

You can also check for and execute pending replays manually:

final replayRequest = await EndpointVault.instance.checkForReplayRequest();
if (replayRequest != null) {
  await EndpointVault.instance.executeReplay(
    replayRequest: replayRequest,
    dio: myAppDio,  // Your app's Dio instance
  );
}

Documentation

Full documentation at endpoint-vault.com/docs

License

MIT License - see LICENSE for details.

Libraries

endpoint_vault
EndpointVault - Encrypted endpoint failure capture for Flutter