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

pom.xml
<dependency>
  <groupId>dev.westyx.nexus</groupId>
  <artifactId>nexus-spring-boot-starter</artifactId>
  <version>0.3.1</version>
</dependency>
Requires Java 17+ and Spring Boot 3+.

Quick start

Add to application.properties (or application.yml):
nexus.base-url=https://your-service.nexus.westyx.dev
nexus.api-key=sk_live_...
Then inject NexusClient:
@Service
public class MyService {

    private final NexusClient nexus;

    public MyService(NexusClient nexus) {
        this.nexus = nexus;
    }

    public void doWork() {
        String dbHost = nexus.getConfig("DB_HOST");
        byte[] dbPass = nexus.getSecret("DB_PASSWORD");
        String cert   = nexus.getSecretFilePath("TLS_CERT"); // temp file
        boolean newUI = nexus.getFlag("new-ui", false);
    }
}

Configuration reference

nexus.base-url=https://your-service.nexus.westyx.dev
nexus.api-key=sk_live_...
nexus.ttl=300           # seconds, default 300
nexus.wif.enabled=true  # Workload Identity Federation
nexus.wif.provider=auto # kubernetes | aws | gcp | azure | auto

API

MethodReturnsDescription
getConfig(key)StringConfig value or null
getConfigAs(key, type)TTyped config
getConfigJson(key)ObjectParsed 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)booleanFlag value; default if not found
evaluateAb(keys, userId, attrs)Map<String,Boolean>A/B evaluation

Workload Identity Federation

nexus.wif.enabled=true
nexus.wif.provider=kubernetes
Or configure via @Bean:
@Bean
public NexusConfig nexusConfig() {
    return NexusConfig.builder()
        .baseUrl("https://your-service.nexus.westyx.dev")
        .wif(WifConfig.builder().enabled(true).provider("auto").build())
        .build();
}

SSE live updates

The starter automatically starts the SSE stream on application startup and tears it down on close(). No additional configuration required.

Error types

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