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

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:

  1. Redact sensitive fields (passwords, tokens, etc.)
  2. Encrypt the request/response data
  3. Send it to the server for storage
  4. Queue it locally if offline

View your captured events and endpoint statistics in the dashboard.

Next steps