Integration

Integrate FaultLens from .NET today. Angular SDK is in development.

FaultLens accepts production events through a single ingest endpoint authenticated with a project API key. The public SDK path available today is .NET. The Angular SDK is in development, and the direct HTTP ingest contract remains the fallback surface for custom or interim integrations.

Use FaultLens.Sdk for .NET when you want the supported SDK path. Use direct HTTPS ingest when you need lower-level control or are bridging another runtime before the SDK is available.

Current SDK status

Available now

.NET SDK

The public .NET SDK is available in the current workspace as FaultLens.Sdk.

In development

Angular SDK

The Angular SDK is in development. Until it is released, Angular apps can post directly to the ingest API.

Fallback

Direct ingest API

The HTTP ingest contract remains available for custom SDK work, workers, and temporary bridge integrations.

Prerequisites

Before integrating, make sure you have:

  • An active FaultLens workspace with at least one project created.
  • A project API key from Project Settings -> API Keys.
  • Your ingest base URL, shown in the same project settings surface.
No project yet? Email hello@faultlens.in or start a conversation. Trial workspaces can be activated within one business day.

.NET SDK

The recommended .NET path is the public SDK package. Use it when you want the supported client surface for exception capture and delivery behavior.

dotnet add package FaultLens.Sdk

Initialize the client

var client = new FaultLensClient(
    new FaultLensOptions(
        apiKey: "YOUR_PROJECT_API_KEY",
        environment: "production",
        release: "1.0.0")
);

Capture exceptions

try
{
    throw new InvalidOperationException("Something broke");
}
catch (Exception ex)
{
    client.CaptureException(ex);
}
Delivery model: capture is fire-and-forget, non-blocking, and safe by default so FaultLens reporting does not interrupt application flow.

ASP.NET Core setup

If you are wiring FaultLens into an ASP.NET Core application, register the options and typed client early, then capture exceptions at the middleware or service layer where context is strongest.

appsettings.json

{
  "FaultLens": {
    "ApiKey": "fl_proj_your_key_here",
    "Environment": "production",
    "Release": "1.4.2",
    "BaseUrl": "https://api.faultlens.in"
  }
}

Program.cs

builder.Services.Configure<FaultLensOptions>(
    builder.Configuration.GetSection("FaultLens"));

builder.Services.AddHttpClient<FaultLensClient>((sp, client) =>
{
    var opts = sp.GetRequiredService<IOptions<FaultLensOptions>>().Value;
    client.BaseAddress = opts.BaseUrl;
    client.Timeout = TimeSpan.FromSeconds(5);
});
Keep your API key out of source control. Use environment variables, user secrets, or your production secrets manager.

Direct ingest fallback

The direct ingest API is still useful when you need lower-level control, want to prototype a custom runtime, or are bridging Angular before the SDK is released.

Minimal custom client shape

using System.Net.Http.Json;

public sealed class FaultLensClient
{
    private readonly HttpClient _http;

    public FaultLensClient(HttpClient http)
    {
        _http = http;
    }

    public async Task CaptureExceptionAsync(Exception ex, CancellationToken ct = default)
    {
        var payload = new
        {
            eventId = Guid.NewGuid().ToString(),
            timestamp = DateTimeOffset.UtcNow,
            environment = "production",
            platform = "dotnet",
            sdk = new { name = "faultlens-dotnet", version = "1.0.0" },
            exception = new
            {
                type = ex.GetType().FullName ?? ex.GetType().Name,
                message = ex.Message
            }
        };

        using var request = new HttpRequestMessage(HttpMethod.Post, "api/events/ingest")
        {
            Content = JsonContent.Create(payload)
        };

        request.Headers.Add("X-API-Key", "fl_proj_your_key_here");
        await _http.SendAsync(request, ct);
    }
}

Angular SDK status

The Angular SDK is currently in development. The intent is to support Angular-native exception capture, route-aware breadcrumbs, and a cleaner integration surface than manual event posting.

Current recommendation: if you need Angular integration immediately, post to the same ingest API directly from your Angular app or from an edge/backend layer that already owns your project key.

If you are planning an Angular integration and want to align with the in-progress SDK direction, contact support@faultlens.in.

Payload reference

Complete field reference for POST /api/events/ingest. Authentication is via X-API-Key: fl_proj_....

FieldTypeRequiredDescription
eventIdstringYesUnique ID for this event. Use a GUID.
timestampDateTimeOffsetYesISO 8601 timestamp for when the event occurred. Always send UTC.
environmentstringYesEnvironment name such as "production" or "staging".
platformstringNoRuntime platform such as "dotnet" or "javascript".
releasestringNoRelease or version tag used to connect events to a deployment.
sdkobjectYes{ name, version } describing the integration source.
exceptionobjectNo*Exception payload. Provide either exception or message.
messagestringNo*Plain message for non-exception events.
breadcrumbsarrayNoOrdered breadcrumb trail leading into the event.

Minimal example payload

POST /api/events/ingest
X-API-Key: fl_proj_your_key_here
Content-Type: application/json

{
  "eventId": "a3f1c2d4-8b7e-4f3a-9c12-1d2e3f4a5b6c",
  "timestamp": "2026-04-01T10:42:00.000Z",
  "environment": "production",
  "platform": "dotnet",
  "release": "1.4.2",
  "sdk": { "name": "faultlens-dotnet", "version": "1.0.0" },
  "exception": {
    "type": "System.NullReferenceException",
    "message": "Object reference not set to an instance of an object."
  }
}

Next steps

Once events are flowing, FaultLens groups them into issues inside your workspace. From there you can connect releases, compare environments, and keep investigation context attached to the problem instead of rebuilding it across tools.

Questions about ingest, SDK direction, or enterprise integration? Email support@faultlens.in - we respond within one business day.