auth.provider API
    Preparing search index...

    Builder context passed to every adapter builder. All fields are optional and additions remain additive-only (non-breaking). Builders may ignore fields they do not need.

    Planned future fields:

    • logger?: Logger (startup-time logging — see D-4 Logger interface)
    • abortSignal?: AbortSignal (timeout-aware init, e.g. database connections)
    • tracer?: Tracer (OpenTelemetry context propagation)
    • metrics?: MetricsRecorder (metrics backend injection)
    interface BuilderContext {
        lifecycle?: LifecycleRegistrar;
    }
    Index

    Properties

    Properties

    lifecycle?: LifecycleRegistrar

    Lifecycle registrar provided by the boot planner. Builders that produce a resource requiring cleanup (database client, interval timer, etc.) SHOULD call:

    ctx.lifecycle?.register(async () => { await resource.close(); })
    

    Optional: factories constructed outside the boot planner (e.g. unit tests) receive {} as ctx, so ctx.lifecycle is undefined. Always use optional chaining.