screeps-api
    Preparing search index...

    Interface ScreepsClientConfig

    User-configurable options for ScreepsHttpClient and ScreepsSocketClient.

    DEFAULT_CLIENT_CONFIG for default values

    interface ScreepsClientConfig {
        defaultShard?: string;
        retry429Global: boolean;
        retry429InitDelay: number;
        retry429MaxDelay: number;
        retry429MaxRetries: number;
        wsKeepAlive: boolean;
        wsKeepAliveInterval: number;
        wsReconnect: boolean;
        wsReconnectInitDelay: number;
        wsReconnectMaxDelay: number;
        wsReconnectMaxRetries: number;
        wsResubscribe: boolean;
    }
    Index

    Properties

    defaultShard?: string

    Specifies a default shard name to use when one is not provided as an argument to a ScreepsHttpClient endpoint function.

    retry429Global: boolean

    Wait for a short period of time before automatically retriing requests that fail due to the global 120 requests/minute rate limit.

    retry429InitDelay: number

    Delay (in milliseconds) before the first retry attempt. Only applies to retries for endpoint-specific rate limits.

    retry429MaxDelay: number

    Maximum delay (in milliseconds) between retry attempts. Only applies to retries for endpoint-specific rate limits.

    retry429MaxRetries: number

    Maximum number of retry attempts. Exponential backoff is used to increase the delay between subsequent retry attempts. Only applies to retries for endpoint-specific rate limits.

    wsKeepAlive: boolean

    If enabled, ping the server every wsKeepAliveInterval to prevent the connection from being closed.

    wsKeepAliveInterval: number

    Time (in milliseconds) between wsKeepAlive pings

    wsReconnect: boolean

    If enabled, ScreepsSocketClient will call reconnect automatically when disconnected.

    wsReconnectInitDelay: number

    The delay (in milliseconds) before the first retry attempt in ScreepsSocketClient.reconnect.

    wsReconnectMaxDelay: number

    The maximum delay (in milliseconds) before a retry attempt in ScreepsSocketClient.reconnect.

    wsReconnectMaxRetries: number

    The maximum number of times ScreepsSocketClient.connect will be called from ScreepsSocketClient.reconnect before giving up and throwing an error.

    wsResubscribe: boolean

    If enabled, all previous subscriptions will be recreated after successfully connecting (automatically or manually).