Global

Methods

createClient(options) → {object}

Source:
Generates a new API client.
Example
const challonge = require('challonge');

const client = challonge.createClient({
	apiKey: '***yourAPIKey***'
});
Parameters:
Name Type Description
options object configuration options for this instance
Properties
Name Type Attributes Description
apiKey string Your challonge API Key
subdomain string <optional>
Sets the subdomain and automatically passes tournament[subdomain] and prefixes the subdomain to tournament urls. If you don't want to pass a subdomain to the constructor, and want to use an organization (or multiple organizations), you must use client.setSubdomain('subdomain') before making api calls.
format string <optional>
The format of the response data. Defaults to 'json'. If set to 'json', will return javascript objects. Anything else (including 'xml') will return the raw text string.
timeout number <optional>
Duration in ms to wait for a timeout, passed to https request as timeout option
massageProperties boolean <optional>
If the response object should be massaged into camelCase properties when using json format. Defaults to true.
Returns:
new api client instance
Type
object