Docs/API Reference/Kernel

Kernel API: configuration and errors

The kernel exposes ConfigService, configuration contracts and a server-side config loader/provider through @veap/kernel/config and @veap/kernel/server. ConfigService provides a…

1 min read

Configuration#

The kernel exposes ConfigService, configuration contracts and a server-side config loader/provider through @veap/kernel/config and @veap/kernel/server. ConfigService provides a get-style access pattern used by Veap providers. The server entry point also exports getVeapConfig and VeapConfigProvider support.

Configuration source precedence is package-specific. For example, the database provider checks its explicit constructor configuration before ConfigService and process environment variables; the intl provider reads a dedicated intl section and its own environment overrides. Follow the relevant package guide instead of assuming a universal merge order.

Error and result helpers#

The kernel exports AppError, HTTP status/error types and result helpers including ok and handleActionError. Auth Server Actions use these helpers to return structured results.

Prefer explicit success/error branches in the application boundary:

ts
const result = await signIn(input);

if (!result.success) {
  // Map the returned error to a safe user-facing message.
  return;
}

// Handle the successful result.

The exact discriminant fields are defined by the installed Result declaration. Confirm them before copying a narrowing pattern into application code; do not expose internal exception messages to users.

veap
Preparing0%