The main Foxhole War API client.

Example

import Foxhole from 'foxhole-client';

const foxhole = new Foxhole();

Hierarchy

  • BaseClient
    • Client

Constructors

Properties

Constructors

  • Create a Client instance for a given shard.

    Parameters

    • shard: number | Dev

      The official Foxhole shard to use

    Returns Client

    Example

    import Foxhole from 'foxhole-client';

    // Any shard
    const foxhole = new Foxhole(123);

    Example

    import Foxhole, { Shard } from 'foxhole-client';

    // Dev branch
    const foxhole = new Foxhole(Shard.Dev);
  • Create a Client instance for a given URL.

    Parameters

    • Optional url: string

      The URL of the War API to use

    Returns Client

    Example

    import Foxhole from 'foxhole-client';

    // Shard 1
    const foxhole = new Foxhole();

    Example

    import Foxhole from 'foxhole-client';

    // Custom URL
    const foxhole = new Foxhole('https://example.com/api');

Properties

map: MapClient = ...

Client for accessing map data on this shard.

url: string

The base URL to use in API requests.

war: WarClient = ...

Client for accessing war data on this shard.