Traq 1.0.0-alpha.1

This is a prerelease version of Traq.
dotnet add package Traq --version 1.0.0-alpha.1
                    
NuGet\Install-Package Traq -Version 1.0.0-alpha.1
                    
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="Traq" Version="1.0.0-alpha.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Traq" Version="1.0.0-alpha.1" />
                    
Directory.Packages.props
<PackageReference Include="Traq" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Traq --version 1.0.0-alpha.1
                    
#r "nuget: Traq, 1.0.0-alpha.1"
                    
#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.
#:package Traq@1.0.0-alpha.1
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Traq&version=1.0.0-alpha.1&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=Traq&version=1.0.0-alpha.1&prerelease
                    
Install as a Cake Tool

dotnet-traq

.NET client library for the traQ API.

The source code is generated from the OpenAPI Spec for the traQ API by Microsoft Kiota.

How to Use

Use in Generic Host

An extension method for the IServiceCollection type can be used.

In the sample code below, an instance of the TraqApiClient class configured by environment variables (TRAQ_BASE_ADDRESS and TRAQ_ACCESS_TOKEN) is added to the service collection.

var host = Host.CreateDefaultApplication(args)
    .ConfigureServices((ctx, services) =>
    {
        services.AddTraqApiClient(options =>
        {
            var conf = ctx.Configuration;
            options.BaseAddress = conf["TRAQ_BASE_ADDRESS"];
            options.BearerAuthToken = conf["TRAQ_ACCESS_TOKEN"];
        });
    })
    .Build();

host.Run();

You can also separate configurator from the AddTraqApiClient method by using parameterless method. In the following code, the added TraqApiClient automatically use configured TraqApiClientOptions.

var host = Host.CreateDefaultApplication(args)
    .ConfigureServices((ctx, services) =>
    {
        services.Configure<TraqApiClientOptions>(ctx.Configuration);
        services.AddTraqApiClient();
    })
    .Build();

host.Run();

Create API Client Manually

The CreateFromOptions method in the TraqApiClientHelper class is useful to create a new instance of the TraqApiClient class with specified options.

TraqApiClientOptions options = new()
{
    BaseAddress = "Base address of the traQ API",
    BearerAuthToken = "Bearer authentication token"
}
var client = TraqApiClientHelper.CreateFromOptions(options);

The TraqApiClient class implements Microsoft.Kiota.Abstractions.BaseRequestBuilder so that you can manually manage methods to access the traQ API.

For more information, please check Kiota Official Documentation.

Source Generation

Docker and Task are required for source generation.

To generate API client for certain version of traQ, set it to the GITHUB_TAG_NAME variable and run task, task gen or task generate-client.

The following command generates API client for traQ v3.25.0.

GITHUB_TAG_NAME=v3.25.0 task
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.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (2)

Showing the top 2 NuGet packages that depend on Traq:

Package Downloads
KnoqNet.Extensions.Authentication

A dotnet extension library for the knoQ API that provides authentication methods with traQ service.

Traq.Bot

A .NET library for traQ BOT works with WebSocker or HttpServer.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.0-alpha.1 143 8/17/2025
0.4.0 292 5/2/2025
0.3.0 324 2/2/2025
0.2.1 122 1/27/2025
0.2.0 145 1/27/2025 0.2.0 is deprecated because it has critical bugs.
0.1.0 227 1/14/2025

Switch API client generator from OpenAPI Generator to Microsoft Kiota and add support for Native AOT. This release contains breaking changes.