Request: credentials property

Baseline Widely available

This feature is well established and works across many devices and browser versions. It’s been available across browsers since March 2017.

The credentials read-only property of the Request interface reflects the value given to the Request() constructor in the credentials option. It determines whether or not the browser sends credentials with the request, as well as whether any Set-Cookie response headers are respected.

Credentials are cookies, TLS client certificates, or authentication headers containing a username and password.

See Including credentials for more details.


A string with one of the following values:


Never send credentials in the request or include credentials in the response.


Only send and include credentials for same-origin requests.


Always include credentials, even for cross-origin requests.


In the following snippet, we create a new request using the Request() constructor (for an image file in the same directory as the script), then save the request credentials in a variable:

const request = new Request("flowers.jpg");
const request = request.request; // returns "same-origin" by default


Fetch Standard
# ref-for-dom-request-credentials②

Browser compatibility

BCD tables only load in the browser

See also