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

pip install westyx-nexus-sdk
Requires Python 3.10+.

Quick start

import asyncio
from westyx_nexus import NexusClient

async def main():
    client = NexusClient(
        base_url='https://your-service.nexus.westyx.dev',
        api_key='sk_live_...',
    )
    await client.sync()

    asyncio.create_task(client.run_stream())  # SSE live updates

    db_host  = client.get_config('DB_HOST')
    db_pass  = client.get_secret('DB_PASSWORD')
    cert     = client.get_secret_file_path('TLS_CERT')  # temp file path
    new_ui   = client.get_flag('new-ui', False)

asyncio.run(main())

Sync usage

from westyx_nexus import NexusClientSync

client = NexusClientSync(
    base_url='https://your-service.nexus.westyx.dev',
    api_key='sk_live_...',
)
client.sync()

db_host = client.get_config('DB_HOST')

Configuration reference

NexusClient(
    base_url='https://your-service.nexus.westyx.dev',
    api_key='sk_live_...',
    ttl=300,               # seconds, default 300
    wif=WIFConfig(enabled=True, provider='auto'),
)

API

MethodReturnsDescription
get_config(key)str | NoneConfig value
get_config_as(key, type)T | NoneTyped config
get_config_json(key)AnyParsed JSON config
get_secret(key)bytesSecret bytes; raises on pk_ key or frontend kind
get_secret_file_path(key)strTemp file path for file-type secrets
get_flag(key, default)boolFlag value; default if not found
evaluate_ab(keys, user_id, attrs)dict[str, bool]A/B evaluation
run_stream()coroutineSSE live updates (async)
close()-Stop and clean up

Workload Identity Federation

from westyx_nexus import NexusClient, WIFConfig

client = NexusClient(
    base_url='https://your-service.nexus.westyx.dev',
    wif=WIFConfig(enabled=True, provider='auto'),
)

Context manager

async with NexusClient(...) as client:
    db_pass = client.get_secret('DB_PASSWORD')

Error types

ExceptionCause
NexusPublicKeyErrorget_secret with pk_live_ key
NexusServiceKindMismatchErrorget_secret on kind=frontend service
NexusBillingError402 - billing blocked
NexusWIFTokenExchangeErrorServer rejected the OIDC token