.NET SDK
The public .NET SDK is available in the current workspace as FaultLens.Sdk.
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.
The public .NET SDK is available in the current workspace as FaultLens.Sdk.
The Angular SDK is in development. Until it is released, Angular apps can post directly to the ingest API.
The HTTP ingest contract remains available for custom SDK work, workers, and temporary bridge integrations.
Before integrating, make sure you have:
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.Sdkvar client = new FaultLensClient(
new FaultLensOptions(
apiKey: "YOUR_PROJECT_API_KEY",
environment: "production",
release: "1.0.0")
);try
{
throw new InvalidOperationException("Something broke");
}
catch (Exception ex)
{
client.CaptureException(ex);
}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.
{
"FaultLens": {
"ApiKey": "fl_proj_your_key_here",
"Environment": "production",
"Release": "1.4.2",
"BaseUrl": "https://api.faultlens.in"
}
}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);
});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.
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);
}
}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.
If you are planning an Angular integration and want to align with the in-progress SDK direction, contact support@faultlens.in.
Complete field reference for POST /api/events/ingest. Authentication is via X-API-Key: fl_proj_....
| Field | Type | Required | Description |
|---|---|---|---|
eventId | string | Yes | Unique ID for this event. Use a GUID. |
timestamp | DateTimeOffset | Yes | ISO 8601 timestamp for when the event occurred. Always send UTC. |
environment | string | Yes | Environment name such as "production" or "staging". |
platform | string | No | Runtime platform such as "dotnet" or "javascript". |
release | string | No | Release or version tag used to connect events to a deployment. |
sdk | object | Yes | { name, version } describing the integration source. |
exception | object | No* | Exception payload. Provide either exception or message. |
message | string | No* | Plain message for non-exception events. |
breadcrumbs | array | No | Ordered breadcrumb trail leading into the event. |
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."
}
}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.