Skip to content

apitoolkit/apitoolkit-dotnet

Repository files navigation

APItoolkit's Logo APItoolkit's Logo

.NET Core SDK

APItoolkit SDK Join Discord Server APItoolkit Docs Build Status NuGet Nuget

APItoolkit is an end-to-end API and web services management toolkit for engineers and customer support teams. To integrate .Net web services with APItoolkit, you need to use this SDK to monitor incoming traffic, aggregate the requests, and then deliver them to the APItoolkit's servers.


Table of Contents


Installation

Kindly run the command below to install the package:

dotnet add package ApiToolkit.Net

Configuration

Next, initialize APItoolkit in your application's entry point (e.g., Program.cs) like so:

using ApiToolkit.Net;

// Initialize the APItoolkit client
var config = new Config
{
    ApiKey = "{ENTER_YOUR_API_KEY_HERE}",
    Debug = false,
    Tags = new List<string> { "environment: production", "region: us-east-1" },
    ServiceVersion: "v2.0",
};
var client = await APIToolkit.NewClientAsync(config);
// END Initialize the APItoolkit client

# Register the middleware to use the initialized client
app.Use(async (context, next) =>
{
    var apiToolkit = new APIToolkit(next, client);
    await apiToolkit.InvokeAsync(context);
});

# app.UseEndpoint(..)
# other middleware and logic
# ...

Note

  • Please make sure the APItoolkit middleware is added before UseEndpoint and other middleware are initialized.
  • The {ENTER_YOUR_API_KEY_HERE} demo string should be replaced with the API key generated from the APItoolkit dashboard.

Important

To learn more configuration options (redacting fields, error reporting, outgoing requests, etc.), please read this SDK documentation.

Contributing and Help

To contribute to the development of this SDK or request help from the community and our team, kindly do any of the following:

License

This repository is published under the MIT license.