Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.nexus.westyx.cloud/llms.txt

Use this file to discover all available pages before exploring further.

Installation

dotnet add package WestyxNexus
Requires .NET 10+.

Quick start

using WestyxNexus;

var client = await NexusClient.CreateAsync(new NexusConfig
{
    BaseUrl = "https://your-service.nexus.westyx.dev",
    ApiKey  = "sk_live_...",
});

_ = client.RunStreamAsync(CancellationToken.None); // SSE live updates

var dbHost = client.GetConfig("DB_HOST");
var dbPass = client.GetSecret("DB_PASSWORD");
var cert   = client.GetSecretFilePath("TLS_CERT"); // temp file path
var newUI  = client.GetFlag("new-ui", false);

Configuration reference

new NexusConfig
{
    BaseUrl = "https://your-service.nexus.westyx.dev",
    ApiKey  = "sk_live_...",
    Ttl     = TimeSpan.FromMinutes(5),
    Wif     = new WifConfig { Enabled = true, Provider = "auto" },
}

API

MethodReturnsDescription
GetConfig(key)string?Config value
GetConfigAs<T>(key)T?Typed config
GetConfigJson(key)JsonElement?Parsed JSON config
GetSecret(key)byte[]Secret bytes; throws on pk_ key or frontend kind
GetSecretFilePath(key)stringTemp file path for file-type secrets
GetFlag(key, default)boolFlag value; default if not found
EvaluateAbAsync(keys, userId, attrs)Task<Dictionary<string,bool>>A/B evaluation
RunStreamAsync(ct)TaskSSE live updates
Dispose()-Stop and clean up

Workload Identity Federation

var client = await NexusClient.CreateAsync(new NexusConfig
{
    BaseUrl = "https://your-service.nexus.westyx.dev",
    Wif = new WifConfig
    {
        Enabled  = true,
        Provider = "auto", // "kubernetes" | "aws" | "gcp" | "azure" | "auto"
    },
});

Dependency injection (ASP.NET Core)

builder.Services.AddNexus(options =>
{
    options.BaseUrl = "https://your-service.nexus.westyx.dev";
    options.ApiKey  = builder.Configuration["Nexus:ApiKey"];
});
Then inject INexusClient into your services.

Error types

ExceptionCause
NexusPublicKeyExceptionGetSecret with pk_live_ key
NexusServiceKindMismatchExceptionGetSecret on kind=frontend service
NexusBillingException402 - billing blocked
NexusWifTokenExchangeExceptionServer rejected the OIDC token