@supabase/middleware - v0.4.0
    Preparing search index...

    Interface Middleware<Key, Config, In, Contribution>

    The shape of a middleware produced by defineMiddleware.

    Three call signatures:

    • Handler (cascade)mw(config, handler) (or mw(handler)) returns the produced fetch handler, with Base pushed inward from the contextual type of the call's return. Base is constrained to In & BaseContext for prerequisite enforcement, and the handler parameter is wrapped in NoConflict for collision detection — both surface at the call site.
    • Handler (propagation) — the same call when the wrapped handler declares prerequisites this layer cannot meet from the inward push alone. Ctx is read outward off that handler and re-published as this layer's own requirement, minus the key it contributes.
    • Config-onlymw(config) (or mw() for config-less) returns an Entry for use in a pipeline array.

    The two directions cannot share one signature: the cascade needs the handler argument to be a dead inference site, and the propagation needs it to be the live one. Splitting them into ordered overloads lets each keep what it needs.

    Type Parameters

    • Key extends string
    • Config
    • In extends object
    • Contribution