Contentful Personalization & Analytics
    Preparing search index...

    Options for createProtectedFetchMethod, combining timeout and retry behavior.

    interface ProtectedFetchMethodOptions {
        apiName?: string;
        fetchMethod?: FetchMethod;
        intervalTimeout?: number;
        onFailedAttempt?: (options: FetchMethodCallbackOptions) => void;
        onRequestTimeout?: (options: FetchMethodCallbackOptions) => void;
        requestTimeout?: number;
        retries?: number;
    }

    Hierarchy (View Summary)

    Index

    Properties

    apiName?: string

    Human-readable name of the API being called.

    Used primarily for logging and error messages.

    fetchMethod?: FetchMethod

    Custom fetch implementation to use instead of the global fetch.

    This is useful for providing polyfills, mocks, or instrumented fetch implementations. It is required in runtimes that do not provide globalThis.fetch.

    intervalTimeout?: number

    Delay (in milliseconds) between retry attempts.

    0

    onFailedAttempt?: (options: FetchMethodCallbackOptions) => void

    Callback invoked whenever a retry attempt fails.

    Type Declaration

    This callback is invoked with additional metadata such as the attempt number and the number of retries left.

    onRequestTimeout?: (options: FetchMethodCallbackOptions) => void

    Callback invoked when a request exceeds the configured timeout.

    Type Declaration

    If this callback is not provided, a default error is logged.

    requestTimeout?: number

    Maximum time (in milliseconds) to wait for a response before aborting the request.

    3000

    retries?: number

    Maximum number of retry attempts.

    1