Initializes the API client with a configuration object and sets up endpoint access. If the config was generated with the generateConfig method, the class's config will update automatically every 6 days
A configuration object containing settings required for API communication.
Provides access to alliance-related API methods.
Provides access to game-related API methods.
Provides access to user-related API methods.
Provides access to utility-related API methods and tools.
Sends a game-specific request to a specified game server.
The unique identifier of the game.
The payload data to include in the request, including game-specific details.
A promise resolving to the response from the game server, typed as T
.
Sends a generic request to the API server with the specified action and data payload.
The action or endpoint to call on the API server.
The payload data to include in the request, provided as key-value pairs.
A promise resolving to the response from the server.
Static
generateGenerates a configuration object by simulating a login process for the specified domain.
This method uses Puppeteer to automate a browser session and interacts with the login page of the given domain. After logging in, it retrieves an iframe source, navigates to it, and extracts the configuration object from the page.
The username to log in with.
The password to log in with.
The domain to target for login and configuration retrieval. Defaults to "supremacy1914.com". Examples: - "supremacy1914.com" for Supremacy 1914 (default) - "callofwar.com" for Call of War - "ironorder1919.com" for Iron Order - "supremacy1914.es" for the Spanish version of Supremacy 1914 (still allows data scrapping in other languages)
Whether to auto generate login every 6 days when being handled by BytroFront instance.
A Promise resolving to the configuration object extracted from the domain.
Represents the BytroFront client, providing access to various API endpoints and utilities for interacting with the game server.