Logos DX
    Preparing search index...

    Interface CookiePlugin<H, P, S>

    Return shape of cookiePlugin() — a FetchPlugin augmented with jar access, adapter lifecycle methods, and a graceful shutdown flush().

    interface CookiePlugin<H = unknown, P = unknown, S = unknown> {
        hooks?: HookEngine<any, [string]>;
        jar: CookieJar;
        name: string;
        flush(): Promise<void>;
        init(): Promise<void>;
        install(engine: FetchEnginePublic<H, P, S>): () => void;
        reconfigure?(value: unknown): void;
        reconfigureGuard?(pendingValue: unknown): void;
    }

    Type Parameters

    • H = unknown
    • P = unknown
    • S = unknown

    Hierarchy (View Summary)

    Index

    Properties

    hooks?: HookEngine<any, [string]>

    The underlying cookie jar. Users may call jar.set, jar.get, etc. directly.

    name: string

    Methods

    • Force any pending coalesced persistence to commit and perform one final save. Call this on graceful shutdown (process exit, logout, etc.).

      Resolves after the save completes; rejects if the adapter throws. A no-op when no adapter is configured.

      Returns Promise<void>

    • Re-applies the plugin's owned policy config after a runtime engine.config.set() on the matching key (retry, dedupePolicy, cachePolicy, rateLimitPolicy, or cookies).

      Optional — a plugin that doesn't implement it is left untouched by runtime config changes; the engine only invokes it when present.

      Parameters

      • value: unknown

        The full, up-to-date value of the plugin's config key

      Returns void

    • Pre-mutation guard for a runtime config.set() on the plugin's owned policy key, consulted by the engine's ownership validator after the ownership check passes but BEFORE the store mutates.

      Throw to reject the whole set() call — single-key or multi-key merge — leaving the store unchanged and skipping reconfigure entirely. Use this for changes reconfigure can't safely apply in place (e.g. the cache plugin rejects an adapter swap: its store is bound to the original adapter at construction).

      Optional — a plugin that doesn't implement it accepts any value for its key.

      Parameters

      • pendingValue: unknown

        The value the plugin's config key would take on if this set() call were applied

      Returns void