toJSON

The toJSON() method of the PublicKeyCredential interface returns a JSON type representation of a PublicKeyCredential.

MDN Reference