DbdTricky.Lib 1.0.0

There is a newer version of this package available.
See the version list below for details.
dotnet add package DbdTricky.Lib --version 1.0.0                
NuGet\Install-Package DbdTricky.Lib -Version 1.0.0                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="DbdTricky.Lib" Version="1.0.0" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add DbdTricky.Lib --version 1.0.0                
#r "nuget: DbdTricky.Lib, 1.0.0"                
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install DbdTricky.Lib as a Cake Addin
#addin nuget:?package=DbdTricky.Lib&version=1.0.0

// Install DbdTricky.Lib as a Cake Tool
#tool nuget:?package=DbdTricky.Lib&version=1.0.0                

DbdTricky.Net

NuGet

This project is not affiliated with Dead by Daylight or with https://dbd.tricky.lol.

A .NET library for interacting with the Dead by Daylight API provided by https://dbd.tricky.lol to quickly retrieve perks, characters, stats, and more! All endpoints listed here are supported.

Usage

With dependency injection

// When using dependency injection
var services = new ServiceCollection();
services.AddDbdTricky();
var sp = services.BuildServiceProvider();

var dbdTrickyClient = sp.GetRequiredService<IDbdTrickyClient>();

// Retrieve all dwight's perks, all endpoints are async and support cancellation tokens
var perks = await dbdTrickyClient.Perks.GetPerks("dwight", cancellationToken: default);

Without dependency injection

// Use defaults from DbdTrickyConfiguration for creating the HttpClient
var configuration = new DbdTrickyConfiguration();
var http = new HttpClient {
    BaseAddress = new Uri(configuration.BaseUrl),;
    DefaultRequestHeaders.Add("User-Agent", configuration.UserAgent);
};

// Create the client and retrieve all dwight's perks
var perksClient = new DbdTrickyPerksClient(http);
var perks = await perksClient.GetPerks("dwight", cancellationToken: default);

Configuration

var configuration = new DbdTrickyConfiguration {
    BaseUrl = new Uri("https://dbd.tricky.lol/api/"),
    UserAgent = "DbdTricky.Lib",
    ApiKey = "your-api-key" // I don't know how API keys work here, does nothing for now
};

// Add the service with the configuration created above, leave it empty to use the defaults
services.AddDbdTricky(configuration: configuration);

// You can also configure the HttpClient directly, note that you do need to set the BaseAddress and UserAgent headers.
services.AddDbdTricky(client => {
    // Use default configuration
    var conf = new DbdTrickyConfiguration();
    client.BaseAddress = new Uri(conf.BaseUrl);
    client.DefaultRequestHeaders.Add("User-Agent", conf.UserAgent);
    
    // Whatever you want to do with the HttpClient
    client.Timeout = TimeSpan.FromSeconds(10);
    client.AddPolicyHandler(Policy
        .HandleResult<HttpResponseMessage>(r => r.StatusCode == HttpStatusCode.TooManyRequests)
        .WaitAndRetryAsync(3, i => TimeSpan.FromSeconds(Math.Pow(2, i)))
    );
});
Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 is compatible. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.0.1 80 11/19/2024
1.0.0 69 11/18/2024