Skip to main content
The official C#/.NET SDK for TrailBase provides a fully-typed, async client for accessing your TrailBase backend from .NET applications.

Installation

Install the TrailBase NuGet package:
Or via Package Manager Console:

Requirements

  • .NET 8.0 or .NET 9.0
  • Compatible with Native AOT compilation

Initialization

Basic Client

Client with Tokens

Authentication

Login

Logout

Current User

Access Tokens

Refresh Token

Record API

Define Your Record Types

List Records

Read a Record

Create a Record

Create Multiple Records

Update a Record

Delete a Record

Filtering

Available Comparison Operators

Real-time Subscriptions

Subscribe to record changes using Server-Sent Events:

Error Handling

Advanced Usage

Custom Fetch

Pagination

Type Definitions

User

Tokens

ListResponse

Pagination

Best Practices

Use nullable reference types (enabled by default in modern .NET) for better null safety.
Store tokens securely using Windows Credential Manager, Azure Key Vault, or similar secure storage.
The SDK is AOT-compatible and works with Native AOT compilation for improved startup time and reduced memory usage.

Example Application