Served.SDK
1.4.0
dotnet add package Served.SDK --version 1.4.0
NuGet\Install-Package Served.SDK -Version 1.4.0
<PackageReference Include="Served.SDK" Version="1.4.0" />
<PackageVersion Include="Served.SDK" Version="1.4.0" />
<PackageReference Include="Served.SDK" />
paket add Served.SDK --version 1.4.0
#r "nuget: Served.SDK, 1.4.0"
#:package Served.SDK@1.4.0
#addin nuget:?package=Served.SDK&version=1.4.0
#tool nuget:?package=Served.SDK&version=1.4.0
Served.SDK
The official .NET SDK for the Served API by UnifiedHQ. This library provides a strongly-typed, modern fluent client for interacting with the Served platform, covering Project Management, Task Tracking, Time Registration, Finance, DevOps, and more.
Links
| Resource | URL |
|---|---|
| UnifiedHQ Platform | unifiedhq.ai |
| Forge DevOps | forge.unifiedhq.ai |
| API Documentation | unifiedhq.ai/docs/api |
| MCP Server | github.com/ThomasHelledi/served-mcp |
| NuGet Package | nuget.org/packages/Served.SDK |
Features
- Module-Based API: Organized access through domain modules (e.g.,
client.ProjectManagement.Projects). - Generic & Abstract: Built on reusable base classes for consistent CRUD operations.
- Strongly Typed: Full type safety for all Served entities (Projects, Tasks, Invoices, etc.).
- Modern Async: Built from the ground up with
async/await. - Bulk Operations: Support for batch create, update, and delete operations.
- Error Handling: Custom
ServedApiExceptionprovides detailed error context. - Backwards Compatible: Legacy client access patterns still supported.
- Tracing & Observability: Built-in OpenTelemetry support with Forge platform integration.
- Fork & Extend: Open source - fork and run your own pipelines.
Installation
dotnet add package Served.SDK
Quick Start
using Served.SDK.Client;
// Initialize with UnifiedHQ infrastructure (default)
var client = new ServedClientBuilder()
.WithToken("YOUR_API_TOKEN")
.WithTenant("YOUR_TENANT_SLUG")
.WithTracing(options => options.EnableForge = true) // Enable Forge analytics
.Build();
// Get projects
var projects = await client.ProjectManagement.Projects.GetAllAsync();
// Create a task
var task = await client.ProjectManagement.Tasks.CreateAsync(new CreateTaskRequest
{
Name = "My Task",
ProjectId = projects.First().Id
});
// Log time
await client.Registration.TimeRegistrations.CreateAsync(new CreateTimeRegistrationRequest
{
TaskId = task.Id,
Minutes = 60,
Description = "Working on task"
});
Configuration
Environment Variables
| Variable | Description | Default |
|---|---|---|
SERVED_API_URL |
API base URL | https://apis.unifiedhq.ai |
SERVED_TRACING_ENABLED |
Enable/disable tracing | false |
SERVED_SERVICE_NAME |
Service identifier | served-sdk-client |
FORGE_API_KEY |
Forge platform API key | - |
FORGE_ENDPOINT |
Forge telemetry endpoint | https://apis.unifiedhq.ai/v1/telemetry |
Initialization Options
// Simple initialization (uses UnifiedHQ infrastructure)
var client = new ServedClient(
baseUrl: ServedClient.DefaultApiUrl, // https://apis.unifiedhq.ai
token: "YOUR_API_TOKEN",
tenant: "YOUR_TENANT_SLUG"
);
// Builder pattern with full control
var client = new ServedClientBuilder()
.WithBaseUrl("https://apis.unifiedhq.ai")
.WithToken(token)
.WithTenant("my-workspace")
.WithTracing(options =>
{
options.ServiceName = "my-application";
options.EnableForge = true;
options.SamplingRate = 0.1;
})
.Build();
// Dependency injection for ASP.NET Core
services.AddHttpClient<IServedClient, ServedClient>(client =>
{
client.BaseAddress = new Uri("https://apis.unifiedhq.ai");
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", "TOKEN");
});
API Modules
| Module | Resources | Description |
|---|---|---|
ProjectManagement |
Projects, Tasks | Project and task management |
DevOpsModule |
Repositories, PullRequests, Pipelines | DevOps integration |
FinanceModule |
Invoices | Invoice management |
SalesModule |
Pipelines, Deals | Sales pipeline and deals |
Registration |
TimeRegistrations | Time tracking |
Companies |
Customers | Customer management |
Identity |
Employees, ApiKeys | User and API key management |
Calendar |
Agreements | Appointments and agreements |
Board |
Boards, Sheets | Kanban boards |
Reporting |
Dashboards, Datasources | Reports and dashboards |
Tenant |
Tenants, Workspaces | Multi-tenant management |
Tracing & Analytics
The SDK includes built-in tracing with OpenTelemetry support and Forge platform integration.
Enable Tracing
var client = new ServedClient("https://apis.unifiedhq.ai", token)
.EnableTracing();
// Or with builder for full control
var client = new ServedClientBuilder()
.WithToken(token)
.WithTracing(options =>
{
options.ServiceName = "my-application";
options.EnableForge = true;
options.SamplingRate = 0.1;
})
.Build();
View Analytics
Once tracing is enabled, view your analytics at:
- Forge Dashboard: forge.unifiedhq.ai/analytics
- Your Workspace: unifiedhq.ai/app/analytics
Custom Events
client.Tracer?.RecordEvent(new TelemetryEvent
{
Type = TelemetryEventType.Custom,
Name = "invoice.generated",
Attributes = new Dictionary<string, object>
{
["invoice.id"] = invoiceId,
["invoice.amount"] = amount
}
});
Fork & Extend
This SDK is open source. Fork it to:
- Run Your Own Pipelines: Fork the repo and run CI/CD in your environment
- Extend Functionality: Add custom modules for your use case
- Contribute Back: Submit PRs to improve the SDK
# Clone your fork
git clone https://github.com/YOUR_USERNAME/served-sdk.git
# Build locally
dotnet build
# Run tests
dotnet test
# Create your own NuGet package
dotnet pack -c Release
Error Handling
try
{
await client.ProjectManagement.Projects.GetAsync(99999);
}
catch (ServedApiException ex) when (ex.StatusCode == HttpStatusCode.NotFound)
{
Console.WriteLine("Project not found.");
}
catch (ServedApiException ex)
{
Console.WriteLine($"API Error: {ex.StatusCode} - {ex.Content}");
}
Support
- Documentation: unifiedhq.ai/docs
- Issues: GitHub Issues
- Discord: UnifiedHQ Community
License
MIT License - see LICENSE for details.
Built with love by UnifiedHQ
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. 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. |
-
net10.0
- Microsoft.Playwright (>= 1.49.0)
- Newtonsoft.Json (>= 13.0.4)
- OpenTelemetry (>= 1.8.0)
- OpenTelemetry.Exporter.OpenTelemetryProtocol (>= 1.8.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
v1.4.0: UnifiedHQ ecosystem integration. Updated all endpoints to apis.unifiedhq.ai. Enhanced Forge observability with analytics dashboard. GitHub Fork support for custom pipelines. See https://unifiedhq.ai/docs for full documentation.