Iskra API Reference
    Preparing search index...

    Interface KernelConfig

    interface KernelConfig {
        clientIpHeader?: ClientIpHeader;
        contract?: ResponseContract;
        environment?: "development" | "production" | "test";
        hostname?: string;
        idleTimeout?: number;
        includeStack?: boolean;
        logger?: false | KernelLogger;
        maxRequestBodySize?: number;
        port?: number;
        securityHeaders?: false | SecurityHeadersConfig;
        shutdownGraceMs?: number;
        trustProxy?: TrustProxy;
    }

    Hierarchy (View Summary)

    Index
    clientIpHeader?: ClientIpHeader

    The header those proxies put the client address in: 'x-forwarded-for' (default) or 'x-real-ip'. Only that one is read.

    contract?: ResponseContract

    The shape of every response: errors, 404s, failed validations and the ok()/list() helpers. Default: Iskra's (iskraContract), which the SDKs read; problemDetailsContract() answers RFC 9457 problem details.

    environment?: "development" | "production" | "test"
    hostname?: string

    Interface to bind. Default "0.0.0.0" (all); use "127.0.0.1" for local only.

    idleTimeout?: number

    Seconds a connection may stay idle before Bun closes it (Bun default: 10).

    includeStack?: boolean

    Send the stack, and the message and context of 5xx errors, in error responses. Default: only with NODE_ENV=development.

    logger?: false | KernelLogger

    Where the Kernel and its features log (startup, fallbacks, errors they handle). Default: the console. false: nothing. WebPlugin passes the App's logger unless one is given here.

    maxRequestBodySize?: number

    Largest request body Bun.serve accepts, in bytes (413 above). Default 16 MiB.

    port?: number
    securityHeaders?: false | SecurityHeadersConfig

    Headers set on every response, merged over the defaults; false sets none.

    shutdownGraceMs?: number

    How long shutdown() waits for in-flight requests before closing connections, in ms. Default 5000.

    trustProxy?: TrustProxy

    Number of reverse proxies in front of the app (true = 1). Only then is clientIpHeader used to identify clients (rate limiting); by default the socket address is used. See getClientIp.