Skip to main content
The official VZaps .NET SDK wraps authentication, HTTP calls, required headers, realtime events, and the main public API resources. Use it in ASP.NET Core APIs, Workers, Windows/Linux services, CLIs, and server-to-server automations.

Requirements

ResourceVersion
.NET.NET Standard 2.0 or higher
Recommended.NET 8 or higher

Install

dotnet add package VZaps.SDK

Create the client

using VZaps;

using var client = new VZapsClient(new VZapsClientOptions
{
    ClientToken = "your-client-token",
    ClientSecret = "your-client-secret",
});
With ASP.NET Core or Worker, register the client in the container:
builder.Services.AddVZapsClient(options =>
{
    options.ClientToken = builder.Configuration["VZaps:ClientToken"];
    options.ClientSecret = builder.Configuration["VZaps:ClientSecret"];
});
Then inject VZapsClient into handlers, controllers, or hosted services.

Credentials

CredentialWhere to useDescription
ClientTokenVZapsClientOptionsAccount client token, also sent as X-Client-Token.
ClientSecretVZapsClientOptionsSecret used by the SDK to obtain and refresh JWTs.
InstanceTokenEach instance callInstance token, sent as X-Instance-Token.
Do not expose ClientSecret or InstanceToken in public front ends.

Automatic authentication

The SDK obtains a JWT with ClientToken and ClientSecret, caches it in memory, and refreshes it before expiry.
var accessToken = await client.Auth.GetAccessTokenAsync();

Client options

OptionDefaultUse
Timeout30 secondsHTTP timeout.
TokenRefreshSkew60 secondsRefresh JWT before actual expiry.
UserAgentSDK defaultHTTP User-Agent header.

Environment variables

VZAPS_CLIENT_TOKEN=your-client-token
VZAPS_CLIENT_SECRET=your-client-secret
VZAPS_INSTANCE_ID=VZ...
VZAPS_INSTANCE_TOKEN=your-instance-token

Typing responses

Examples use object or JsonElement when the response can vary. In production, you can create your own DTOs and pass them as TResponse.
var response = await client.Instances.ListAsync<JsonElement>(new InstanceListRequest
{
    Page = 1,
    PageSize = 20,
});

Next steps