Node interface for the Lokalise APIv2.
To configure timeouts, set the requestTimeout optional parameter. The value is in milliseconds:
const client = new LokaliseApi({
apiKey: "API_KEY",
requestTimeout: 5e3,
});
By default:
LokaliseApi are sent to https://api.lokalise.com/api2/.LokaliseApiV1 are sent to https://api.lokalise.com/v1/.https://app.lokalise.com.https://ota.lokalise.com.To override the API host, pass the host option when creating a client:
const client = new LokaliseApi({
// other config ...
host: "http://example.com",
});
The same option is supported by all client types. Then use your client as usual.
If your environment requires an HTTP or HTTPS proxy to access the Lokalise API, recent Node.js versions provide built-in proxy support for native fetch.
Set the appropriate proxy environment variables:
HTTPS_PROXY=http://proxy.example.com:8080
HTTP_PROXY=http://proxy.example.com:8080
Then enable proxy support when starting Node.js:
node --use-env-proxy app.js
Alternatively, set the NODE_USE_ENV_PROXY environment variable:
NODE_USE_ENV_PROXY=1 node app.js
You can also use NO_PROXY to exclude specific hosts from proxying.
Built-in environment proxy support is available in Node.js 24.5.0+ and 22.21.0+.
To supress all warning messages, set the silent option to true (false by default):
const client = new LokaliseApi({
// other config ...
silent: true,
});