files/en-us/web/api/publickeycredential/authenticatorattachment/index.md
{{APIRef("Web Authentication API")}}{{securecontext_header}}
The authenticatorAttachment read-only property of the {{domxref("PublicKeyCredential")}} interface is a string that indicates the general category of authenticator used during the associated {{domxref("CredentialsContainer.create()","navigator.credentials.create()")}} or {{domxref("CredentialsContainer.get()","navigator.credentials.get()")}} call.
A string, which will be one of the following values:
"platform"
"cross-platform"
const options = {
challenge: new Uint8Array(26) /* from the server */,
rp: {
name: "Example CORP",
id: "login.example.com",
},
user: {
id: new Uint8Array(26) /* To be changed for each user */,
name: "[email protected]",
displayName: "Carina Anand",
},
pubKeyCredParams: [
{
type: "public-key",
alg: -7,
},
],
};
navigator.credentials
.create({ publicKey: options })
.then((pubKeyCredential) => {
const attachment = pubKeyCredential.authenticatorAttachment;
// Do something with authenticatorAttachment
})
.catch((err) => {
// Deal with any error
});
{{Specifications}}
{{Compat}}