By default, the SDK has a timeout of 5s when running in a node.js environment, and uses the browser defaults when run inside a browser (using the fetch API).
It is possible to overwrite the transport layer (see The Transport Protocol and use your own code to make and configure HTTP requests) to tune the timeout value. It is a bit cumbersome though.
Instead, you can use the timeout parameter, and set it either globally, as a connection parameter, or even at the API call level but using the PushDown mechanism described below.
Sets a timeout of 10s gloally
const connectionParameters = sdk.ConnectionParameters.ofUserAndPassword( "https://myInstance.campaign.adobe.com", "admin", "admin", { timeout: 10000 });
Override the timeout to 1 min for a particular API call
NLWS.xml.pushDown({ timeout: 60000 }).xtkBuilder.installPackage(dom);