Profile

Profile

A profile of personas with identity claims

Constructor

new Profile(personas)

Description:
  • Create a new profile

Source:
Example
const claim = Claim('https://alice.tld', '123');
const pers = Persona('Alice', 'About Alice', [claim]);
const profile = Profile([pers]);
Parameters:
Name Type Description
personas Array.<Persona>

Personas of the profile

Classes

Profile

Members

identifier :string

Description:
  • Identifier of the profile (fingerprint, email address, uri...)

Source:

Identifier of the profile (fingerprint, email address, uri...)

Type:
  • string

personas :Array.<Persona>

Description:
  • List of personas

Source:

List of personas

Type:

primaryPersonaIndex :number

Description:
  • Index of primary persona (to be displayed first or prominently)

Source:

Index of primary persona (to be displayed first or prominently)

Type:
  • number

profileType :ProfileType

Description:
  • Profile version

Source:

Profile version

Type:
  • ProfileType

publicKey :module:types~ProfilePublicKey

Description:
  • The cryptographic key associated with the profile

Source:

The cryptographic key associated with the profile

Type:

verifiers :Array.<module:types~ProfileVerifier>

Description:
  • List of verifier URLs

Source:

List of verifier URLs

Type:

Methods

addVerifier(name, url)

Description:
  • Add profile verifier to the profile

Source:
Parameters:
Name Type Description
name string

Name of the verifier

url string

URL of the verifier

toJSON() → {object}

Description:
  • Get a JSON representation of the profile

Source:
Returns:

JSON representation of the profile

Type
object

(static) fromJSON(profileObject) → {Profile|Error}

Description:
  • Parse a JSON object and convert it into a profile

Source:
Example
doip.Profile.fromJSON(JSON.stringify(profile));
Parameters:
Name Type Description
profileObject object

JSON representation of a profile

Returns:

Parsed profile

Type
Profile | Error