How Do I Adjust the Timeout for Fetch API POST Requests?

I am utilizing the fetch method to execute a POST request and include credentials. Below is an example of my implementation:

async function sendData(apiEndpoint, dataPackage) {
    const result = await fetch(apiEndpoint, {
        method: 'POST',
        body: dataPackage,
        credentials: 'include'
    });
    return result.json();
}

I am trying to figure out what timeout is applied automatically when using this fetch request. Additionally, I would like to know how to change this setting to enforce a timeout of 3 seconds or even keep it waiting indefinitely. Any guidance or suggestions on configuring the request timeout would be very helpful.

ya, fetch doesnt auto apply a timeout. use abortcontroller with setTimeout to cancel the request after 3 secs if needed. no easy way to keep it waiting indefinately either, you’ll just need to handle your abort logic