Integration

FaultLens supports any platform.

FaultLens works with any application stack. Use an official SDK for streamlined setup, or integrate directly through the documented HTTP ingestion API. Official SDKs cover .NET, TypeScript / JavaScript, React, and Angular. Any other platform capable of making an authenticated HTTPS request sends the canonical event envelope directly. Both paths use the same project API key and the same event contract.

Unified integration: use FaultLens.SDK for .NET or the @faultlenshq/browser, @faultlenshq/angular, and @faultlenshq/react packages for frontend apps. Direct HTTP API: POST the canonical envelope directly from Java, Python, Go, PHP, Ruby, Rust, C++, serverless functions, proprietary runtimes, or legacy systems — a first-class option using the same backend contract.

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 an official SDK or the direct HTTP API 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.

Available now

TypeScript / JavaScript, React, and Angular SDKs

@faultlenshq/browser, @faultlenshq/angular, and @faultlenshq/react are released as a synchronized 1.0.0 family.

First-class

Custom integration (direct ingest)

Send the canonical event envelope directly from any language or runtime. Not a fallback — a supported integration path using the same contract.

Choose your integration path

Unified integration

Use an official SDK

Recommended when an official SDK exists (.NET, browser, Angular, React). You get typed APIs, automatic context capture, breadcrumbs, identity helpers, consistent retries, framework integration, and less setup code.

Custom integration

Send the envelope directly

Recommended when no official SDK exists, you use a proprietary runtime or custom transport, or you already have an internal telemetry pipeline. Language-neutral, same backend contract, no dependency on an SDK release — you own payload creation, retries, redaction, and context.

Safety: custom integration must follow the canonical contract. Direct integration is not permission to send secrets or unnecessary personal data. Browser and mobile clients must use the supported client-key and CORS model; server-side secrets must never be embedded in public frontend code.

Additional official SDKs will be prioritized using customer demand and ecosystem feedback. We do not commit to an SDK for every language or to specific delivery dates.

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.
  • Send events to the ingestion host shown in your project settings, such as https://YOUR-WORKSPACE.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

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.

Custom integration (direct ingest)

Any platform that can make an authenticated HTTPS request can send the canonical event envelope directly — no official SDK required. This is a first-class integration option using the same backend contract. You own envelope construction, retries, redaction, and context collection.

Full reference: the complete envelope, reserved metadata, response semantics, and retry guidance are documented in the HTTP ingestion API reference.

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.1.1" },
            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);
    }
}

TypeScript / JavaScript, React, and Angular SDKs

The browser, Angular, and React packages are the official frontend SDKs for error monitoring and diagnostics context capture. The framework packages wrap the browser SDK with framework-friendly APIs. All three are released together as a synchronized 1.0.0 family.

npm install @faultlenshq/browser@1.0.0
npm install @faultlenshq/angular@1.0.0 @faultlenshq/browser@1.0.0
npm install @faultlenshq/react@1.0.0 @faultlenshq/browser@1.0.0 react react-dom

The wrapper packages pin a compatible @faultlenshq/browser through their peerDependencies, so installing the matching 1.0.0 pair resolves cleanly.

Before production: confirm tenant endpoint, project ID, and API key handling before sending production browser events. The project API key is public by design in browser apps — use the key intended for client use.

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.1.1" },
  "exception": {
    "type": "System.NullReferenceException",
    "message": "Object reference not set to an instance of an object."
  }
}

Business severity metadata (reserved tags)

FaultLens classifies severity from observed impact and never infers business criticality from routes, URLs, or stack traces. To mark an event as business-critical, send explicit metadata under reserved tags keys. The backend consumes exactly three: faultlens.capability, faultlens.criticality (critical | high | normal | low), and faultlens.operation — where operation may name a route, workflow, job, or command.

"tags": {
  "faultlens.capability": "checkout",
  "faultlens.criticality": "critical",
  "faultlens.operation": "payment-capture"
}

Response contract

Every business outcome returns HTTP 200 with a JSON body — inspect status rather than assuming success. status: 1 is Ingested (stored). status: 2 is Dropped (for example reasonCode: "billing_limit_exceeded" — accepted by the endpoint but not stored). status: 3 is Rejected. HTTP 401 means a missing or invalid X-API-Key or the wrong host; 429 and 5xx are retryable with backoff. Do not treat every HTTP 200 as accepted.

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.