Helia Verified Fetch
    Preparing search index...

    Represents the ephemeral, modifiable state used by the pipeline.

    • Mutable: Evolves as you walk the plugin chain.
    • Shared Data: Allows plugins to communicate partial results, discovered data, or interim errors.
    • Ephemeral: Typically discarded once fetch(...) completes.
    interface PluginContext {
        accept?: AcceptHeader;
        byteRangeContext?: ByteRangeContext;
        cid: CID;
        directoryEntries?: UnixFSEntry[];
        errors?: PluginError[];
        ipfsPath: string;
        isDirectory?: boolean;
        modified: number;
        options?: Omit<VerifiedFetchInit, "signal"> & AbortOptions;
        path: string;
        pathDetails?: PathWalkerResponse;
        plugins: string[];
        protocol: string;
        query: UrlQuery;
        reqFormat?: RequestFormatShorthand;
        resource: string;
        serverTiming: ServerTiming;
        ttl: number;
        onProgress?(evt: CustomProgressEvent<any>): void;
        [key: string]: unknown;
    }

    Hierarchy (View Summary)

    Indexable

    • [key: string]: unknown
    Index

    Properties

    accept?: AcceptHeader
    byteRangeContext?: ByteRangeContext

    ByteRangeContext contains information about the size of the content and range requests. This can be used to set the Content-Length header without loading the entire body.

    This is set by the ByteRangeContextPlugin

    cid: CID
    directoryEntries?: UnixFSEntry[]
    errors?: PluginError[]
    ipfsPath: string
    isDirectory?: boolean
    modified: number

    The last time the context is modified, so we know whether a plugin has modified it. A plugin should increment this value if it modifies the context.

    options?: Omit<VerifiedFetchInit, "signal"> & AbortOptions
    path: string
    pathDetails?: PathWalkerResponse
    plugins: string[]

    An array of plugin IDs that are all enabled. You can use this to check if a plugin is enabled and respond accordingly.

    protocol: string
    query: UrlQuery
    resource: string
    serverTiming: ServerTiming
    ttl: number

    Methods