impit
    Preparing search index...

    Interface ImpitOptions

    Options for configuring an Impit instance.

    These options allow you to customize the behavior of the Impit instance, including browser emulation, TLS settings, proxy configuration, timeouts, and more.

    If no options are provided, default settings will be used.

    See Impit for usage.

    interface ImpitOptions {
        browser?: Browser;
        cookieJar?: {
            getCookieString: (url: string) => string | Promise<string>;
            setCookie: (cookie: string, url: string, cb?: any) => void | Promise<void>;
        };
        followRedirects?: boolean;
        headers?: Record<string, string>
        | [string, string][]
        | Headers;
        http3?: boolean;
        ignoreTlsErrors?: boolean;
        localAddress?: string;
        maxRedirects?: number;
        proxyUrl?: string;
        timeout?: number;
        vanillaFallback?: boolean;
    }
    Index

    Properties

    browser?: Browser

    What browser to emulate.

    undefined (no browser emulation)

    cookieJar?: {
        getCookieString: (url: string) => string | Promise<string>;
        setCookie: (cookie: string, url: string, cb?: any) => void | Promise<void>;
    }

    Pass a ToughCookie instance to Impit.

    This impit instance will use the provided cookie jar for both storing and retrieving cookies.

    undefined (no cookie jar, i.e., cookies are not stored or sent across requests)

    followRedirects?: boolean

    Whether to follow redirects or not.

    true

    headers?: Record<string, string> | [string, string][] | Headers

    Additional headers to include in every request made by this Impit instance.

    Can be an object, a Map, or an array of tuples or an instance of the Headers class.

    undefined (no additional headers)

    http3?: boolean

    Enable HTTP/3 support.

    false

    ignoreTlsErrors?: boolean

    Ignore TLS errors such as invalid certificates.

    false

    localAddress?: string

    Local address to bind the client to. Useful for testing purposes or when you want to bind the client to a specific network interface.

    Can be an IP address in the format xxx.xxx.xxx.xxx (for IPv4) or ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff (for IPv6).

    undefined (the OS will choose the local address)

    maxRedirects?: number

    Maximum number of redirects to follow.

    If this number is exceeded, the request will be rejected with an error.

    10

    proxyUrl?: string

    Proxy URL to use for this Impit instance.

    Supports HTTP, HTTPS, SOCKS4 and SOCKS5 proxies.

    undefined (no proxy)

    timeout?: number

    Default timeout for this Impit instance in milliseconds.

    vanillaFallback?: boolean

    Whether to fallback to a vanilla user-agent if the emulated browser is not supported by the target website.

    false