files/en-us/web/api/passwordcredential/index.md
{{SeeCompatTable}}{{APIRef("Credential Management API")}}{{securecontext_header}}
The PasswordCredential interface of the Credential Management API provides information about a username/password pair. In supporting browsers an instance of this class may be passed in the credential member of the init object for global {{domxref("Window/fetch", "fetch()")}}.
[!NOTE] This interface is restricted to top-level contexts and cannot be used from an {{HTMLElement("iframe")}}.
{{InheritanceDiagram}}
PasswordCredential object.Inherits properties from its ancestor, {{domxref("Credential")}}.
None.
const cred = new PasswordCredential({
id,
password,
name,
iconURL,
});
navigator.credentials.store(cred).then(() => {
// Do something else.
});
{{Specifications}}
{{Compat}}