Integration

Integrate FaultLens from .NET, browser, Angular, and React applications.

FaultLens accepts production events through a single ingest endpoint authenticated with a project API key. The public .NET SDK is available today, with released beta browser, Angular, and React SDK packages available for early integration testing. The direct HTTP ingest contract remains the fallback surface for custom integrations.

Use FaultLens.SDK for .NET when you want the NuGet package path. Use the beta @faultlenshq/browser, @faultlenshq/angular, and @faultlenshq/react packages when validating frontend capture. Use direct HTTPS ingest when you need lower-level control.

Validate the signal before wiring every surface.

Start by proving one event reaches the right project, then add the context that makes the issue useful for diagnosis. The goal is not just ingestion. The goal is a production issue your team can actually investigate.

Step 1

Create project key

Copy the scoped API key and ingest host from Project Settings.

Step 2

Send one event

Use the closest SDK or direct ingest fallback to capture a test failure.

Step 3

Confirm issue

Open the FaultLens project and confirm the event is attached to an issue.

Step 4

Add release and environment

Attach deployment and runtime labels so teams can reason about what changed.

Step 5

Add breadcrumbs

Preserve the path into the failure so the issue is useful after the first alert.

Current SDK status

Available now

.NET SDK

The public .NET SDK is available as the NuGet package FaultLens.SDK.

Beta

Browser, Angular, and React SDKs

@faultlenshq/browser, @faultlenshq/angular, and @faultlenshq/react are released beta integration packages.

Fallback

Direct ingest API

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

Guide index

Start with the SDK or workflow guide closest to the application you are instrumenting. These pages are public, crawlable references for real integration tasks rather than a separate SEO directory.

Sample repositories

The fastest way to validate a FaultLens integration is to run a sample against your own tenant workspace. The sample repositories include realistic setup, local run instructions, and verification steps.

.NET

ASP.NET Core sample

Demonstrates FaultLens.SDK with DI registration, request-scoped breadcrumbs, diagnostics context, message capture, handled exception capture, and global exception handling.

Open .NET samples
Frontend

Browser, Angular, and React samples

Demonstrates @faultlenshq/browser, @faultlenshq/angular, and @faultlenshq/react with tenant-host configuration, project keys, user IDs, tags, and test events.

Open frontend samples
Verify

What to confirm

After sending sample events, open your FaultLens project and confirm environment, release, requested URL, user identity, tags, and breadcrumbs are attached to the event.

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.
  • For current staging and beta validation, use your tenant host directly, such as https://TENANT-SLUG.staging.faultlens.in.
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 NuGet package. Use it when you want the supported client surface for exception capture and delivery behavior.

dotnet add package FaultLens.SDK --version 0.1.0-beta.2

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.AddSingleton<FaultLensClient>(sp =>
{
    var config = sp.GetRequiredService<IConfiguration>();
    var apiKey = config["FaultLens:ApiKey"];
    var endpoint = new Uri(config["FaultLens:Endpoint"]!);

    return new FaultLensClient(new FaultLensOptions(
        apiKey: apiKey!,
        environment: config["FaultLens:Environment"] ?? "production",
        release: config["FaultLens:Release"],
        endpoint: endpoint,
        breadcrumbCapacity: 40));
});

builder.Services.AddSingleton<IFaultLensClient>(sp =>
    sp.GetRequiredService<FaultLensClient>());

Request context and tags

using (var scope = client.BeginRequest("GET", "/orders/{id}"))
{
    scope.SetRequestContext(
        url: "https://api.example.com/orders/123",
        referrer: null,
        userAgent: "sample-client");
    scope.SetUserId("user-123");
    scope.SetTag("feature", "checkout");

    client.AddStep("checkout", "Payment flow started");
    client.CaptureMessage("Checkout validation failed");
}
Keep your API key out of source control. Use environment variables, user secrets, or your production secrets manager.

For a complete working ASP.NET Core setup, use the FaultLens .NET samples.

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 a frontend/runtime before a higher-level SDK fits your application.

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);
    }
}

Browser, Angular, and React SDKs

The browser, Angular, and React packages are released beta integration surfaces for frontend error monitoring and diagnostics context capture. The framework packages wrap the browser SDK with framework-friendly APIs.

npm install @faultlenshq/browser@beta
npm install @faultlenshq/angular@beta @faultlenshq/browser@0.1.0-beta.3
npm install @faultlenshq/react@beta @faultlenshq/browser@0.1.0-beta.3
Beta status: use these packages for early integration validation. Confirm tenant endpoint, project ID, and API key handling before sending production browser events.

If you need help choosing between the browser SDK, Angular SDK, React SDK, or direct ingest API, contact support@faultlens.in. See also browser SDK setup and Angular integration or React integration.

For cloneable examples, use the FaultLens frontend samples.

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.