files/en-us/web/api/credential/index.md
{{APIRef("Credential Management API")}}{{securecontext_header}}
The Credential interface of the Credential Management API provides information about an entity (usually a user) normally as a prerequisite to a trust decision.
Credential objects may be of the following types:
password, federated, public-key, identity and otp. (For {{domxref("PasswordCredential")}}, {{domxref("FederatedCredential")}}, {{domxref("PublicKeyCredential")}}, {{domxref("IdentityCredential")}} and {{domxref("OTPCredential")}})false. Subclasses may override this value.const pwdCredential = new PasswordCredential({
id: "example-username", // Username/ID
name: "Carina Anand", // Display name
password: "correct horse battery staple", // Password
});
console.assert(pwdCredential.type === "password");
{{Specifications}}
{{Compat}}