Skip to content

TheM.onboarding Reference

Constructor

The parent TheM class contains functionality enabling the initialization of any TheM subclass or submodule instance by simply calling TheM.doInit('subclassName'), where the input string is a case sensitive space-delimited string containing the names of all submodules that may be required in the current session. Most TheM subclasses also require the 'common' submodule. It is common to initialize the target submodule and any other submodule dependencies concurrently. The following example will initialize a new instance of the necessary submodules using a proxy constructor in TheM parent class.

TheM.doInit('subclassName1 subclassName2 subclassName3 etc');

Example

TheM.doInit('common onboarding');

Properties

Property table for TheM.onboarding

Property Description Required Schema
socket Gets (returns) the current socket connection instance, if any. No {
  "title": "TheM.onboarding.socket",
  "type": "object",
  "description": "Gets (returns) the current socket
connection instance, if any.",
  "$comment": "getter",
  "examples": [],
  "nullable": true
}
isReady Gets (returns) or sets true if TheM.onboarding is fully ready. When setting isReady true for the first time, a(n) 'TheM.onboarding ready' event is also triggered. Yes {
  "title": "TheM.onboarding.isReady",
  "type": "boolean",
  "description": "Gets (returns) or sets true if
TheM.onboarding is fully ready. When setting
isReady true for the first time, a(n)
'TheM.onboarding ready' event is also
triggered.",
  "$comment": "getter setter",
  "examples": [
    true,
    false
  ],
  "default": false,
  "nullable": false
}
preSegment Gets (returns) or sets the presegment. Yes {
  "title": "TheM.onboarding.preSegment",
  "type": "string",
  "description": "Gets (returns) or sets the
presegment.",
  "$comment": "enumerable getter setter",
  "examples": [
    "demo_uoiuqwehflkipahgoqq"
  ],
  "nullable": false
}
client Gets (returns) the TheM.onboarding.client object. Yes client object
isDocumentCaptured Gets (returns) true if a document has been captured. No {
  "title":
"TheM.onboarding.isDocumentCaptured",
  "type": "boolean",
  "description": "Gets (returns) true if a document
has been captured.",
  "$comment": "enumerable getter",
  "examples": [
    true,
    false
  ],
  "default": false
}
isDocumentDelivered Gets (returns) true if a document has been delivered to the server. No {
  "title":
"TheM.onboarding.isDocumentDelivered",
  "type": "boolean",
  "description": "Gets (returns) true if a document
has been delivered to the server.",
  "$comment": "enumerable getter",
  "examples": [
    true,
    false
  ],
  "default": false
}
isProspectDataDelivered Gets (returns) true if the prospect (client) data has been delivered to the server. No {
  "title":
"TheM.onboarding.isProspectDataDelivered",
  "type": "boolean",
  "description": "Gets (returns) true if the
prospect (client) data has been delivered to the
server.",
  "$comment": "enumerable getter",
  "examples": [
    true,
    false
  ],
  "default": false
}
isTCSeen Gets (returns) true if the prospect (client) has seen the terms and conditions. No {
  "title": "TheM.onboarding.isTCSeen",
  "type": "boolean",
  "description": "Gets (returns) true if the
prospect (client) has seen the terms and
conditions.",
  "$comment": "enumerable getter setter",
  "examples": [
    true,
    false
  ],
  "default": false
}
isRecoveryMode Gets (returns) true if onboarding is in recovery mode. No {
  "title": "TheM.onboarding.isRecoveryMode",
  "type": "boolean",
  "description": "Gets (returns) true if onboarding
is in recovery mode.",
  "$comment": "enumerable getter setter",
  "examples": [
    true,
    false,
    null
  ]
}
isBeingUpgraded Gets (returns) true if being upgraded. No {
  "title": "TheM.onboarding.isBeingUpgraded",
  "type": "boolean",
  "description": "Gets (returns) true if being
upgraded.",
  "$comment": "enumerable getter setter",
  "examples": [
    true,
    false
  ],
  "default": false
}
_isBeingRegistered Gets (returns) true if prospect (client) is currently being registered. No {
  "title":
"TheM.onboarding._isBeingRegistered",
  "type": "boolean",
  "description": "Gets (returns) true if prospect
(client) is currently being registered.",
  "$comment": "enumerable getter",
  "examples": [
    true,
    false
  ],
  "default": false
}
imageQueue Gets (returns) the imageQueue object. Use TheM.onboarding.imageQueue.push({type, imageBase64}) to push images onto the queue for sending to the server. No imageQueue object
recoveryCode Gets (returns) a random recovery code for the device. No {
  "title": "TheM.onboarding.recoveryCode",
  "type": "string",
  "description": "Gets (returns) a random recovery
code for the device.",
  "$comment": "enumerable getter",
  "examples": [
    "qwert12345"
  ]
}

Property table for imageQueue object

Property Description Required Schema
isSendingDone Gets (returns) true if the image is done sending to the server. No {
  "title":
"TheM.onboarding.imageQueue.isSendingDone",
  "type": "boolean",
  "description": "Gets (returns) true if the image is
done sending to the server.",
  "examples": [
    true,
    false
  ],
  "default": false
}
length Gets (returns) the length of the onboarding.imageQueue array. Yes {
  "title": "TheM.onboarding.imageQueue.length",
  "type": "number",
  "description": "Gets (returns) the length of the
onboarding.imageQueue array.",
  "examples": [
    1
  ],
  "default": 0,
  "nullable": false
}
push Gets (returns) a function that can be used to push images onto the imageQueue image array. No {
  "title": "TheM.onboarding.imageQueue.push",
  "type": "function",
  "description": "Gets (returns) a function that can
be used to push images onto the imageQueue image
array.",
  "examples": [
    "TheM.onboarding.imageQueue.push({ type: 'Face
image', imageBase64: 'LongBase64ImageString'
});"
  ]
}

Property table for client object

Property Description Required Schema
email Gets (returns) or sets the client email. Yes {
  "title": "TheM.onboarding.client.email",
  "type": "string",
  "description": "Gets (returns) or sets the client
email.",
  "examples": [
    "testemail@email.test"
  ],
  "nullable": false
}
mobile Gets (returns) or sets the client mobile. Yes {
  "title": "TheM.onboarding.client.mobile",
  "type": "string",
  "description": "Gets (returns) or sets the client
mobile.",
  "examples": [
    "5556667777"
  ],
  "nullable": false
}
isIntroSeen Gets (returns) or sets true if the client has seen the intro screen. No {
  "title":
"TheM.onboarding.client.isIntroSeen",
  "type": "boolean",
  "description": "Gets (returns) or sets true if the
client has seen the intro screen.",
  "examples": [
    true,
    false
  ],
  "default": false
}
isTCSeen Gets (returns) or sets true if the client has seen the terms and conditions. No {
  "title": "TheM.onboarding.client.isTCSeen",
  "type": "boolean",
  "description": "Gets (returns) or sets true if the
client has seen the terms and conditions.",
  "examples": [
    true,
    false
  ],
  "default": false
}
name name Yes {
  "firstName": {
    "title":
"TheM.onboarding.client.name.firstName",
    "type": "string",
    "description": "Gets (returns) or sets the client
firstName.",
    "examples": [
      "Suzy"
    ],
    "nullable": false
  },
  "middleName": {
    "title":
"TheM.onboarding.client.name.middleName",
    "type": "string",
    "description": "Gets (returns) or sets the client
middleName.",
    "examples": [
      "Queue"
    ]
  },
  "lastName": {
    "title":
"TheM.onboarding.client.name.lastName",
    "type": "string",
    "description": "Gets (returns) or sets the client
lastName.",
    "examples": [
      "Tester"
    ],
    "nullable": false
  },
  "nullable": false
}
dob dob Yes {
  "day": {
    "title": "TheM.onboarding.client.dob.day",
    "type": "string",
    "description": "Gets (returns) or sets the client
date of birth day.",
    "examples": [
      "01"
    ],
    "nullable": false
  },
  "month": {
    "title": "TheM.onboarding.client.dob.month",
    "type": "string",
    "description": "Gets (returns) or sets the client
date of birth month.",
    "examples": [
      "15"
    ],
    "nullable": false
  },
  "year": {
    "title": "TheM.onboarding.client.dob.year",
    "type": "string",
    "description": "Gets (returns) or sets the client
date of birth year.",
    "examples": [
      "1975"
    ],
    "nullable": false
  },
  "nullable": false
}
address address Yes {
  "addressLine1": {
    "title":
"TheM.onboarding.client.address.addressLine1"
,
    "type": "string",
    "description": "Gets (returns) or sets the client
addressLine1.",
    "examples": [
      "123 Main Str."
    ],
    "nullable": false
  },
  "addressLine2": {
    "title":
"TheM.onboarding.client.address.addressLine2"
,
    "type": "string",
    "nullable": true,
    "description": "Gets (returns) or sets the client
addressLine2.",
    "examples": [
      "Apt. 123"
    ]
  },
  "city": {
    "title":
"TheM.onboarding.client.address.city",
    "type": "string",
    "description": "Gets (returns) or sets the client
city.",
    "examples": [
      "Harrisburg"
    ],
    "nullable": false
  },
  "state": {
    "title":
"TheM.onboarding.client.address.state",
    "type": "string",
    "description": "Gets (returns) or sets the client
state.",
    "examples": [
      "PA"
    ],
    "nullable": false
  },
  "postalCode": {
    "title":
"TheM.onboarding.client.address.postalCode",
    "type": "string",
    "description": "Gets (returns) or sets the client
postalCode.",
    "examples": [
      "12345"
    ],
    "nullable": false
  },
  "countryCode": {
    "title":
"TheM.onboarding.client.address.countryCode",
    "type": "string",
    "examples": [
      "USA"
    ],
    "description": "Gets (returns) or sets the client
countryCode.",
    "default": "US",
    "nullable": false
  },
  "nullable": false
}
extra extra No {
  "sex": {
    "title": "TheM.onboarding.client.extra.sex",
    "type": "string",
    "description": "Gets (returns) or sets the client
sex.",
    "examples": [
      "female"
    ]
  },
  "eyeColor": {
    "title":
"TheM.onboarding.client.extra.eyeColor",
    "type": "string",
    "description": "Gets (returns) or sets the client
eyeColor.",
    "examples": [
      "BRO"
    ]
  },
  "hairColor": {
    "title":
"TheM.onboarding.client.extra.hairColor",
    "type": "string",
    "description": "Gets (returns) or sets the client
hairColor.",
    "examples": [
      "BLK"
    ]
  },
  "heightMetric": {
    "title":
"TheM.onboarding.client.extra.heightMetric",
    "type": "string",
    "description": "Gets (returns) or sets the client
height in metric units (cm).",
    "examples": [
      "181"
    ]
  },
  "weightMetric": {
    "title":
"TheM.onboarding.client.extra.weightMetric",
    "type": "string",
    "description": "Gets (returns) or sets the client
weight in metric units (kg).",
    "examples": [
      "85"
    ]
  }
}
ssn Gets (returns) or sets the client ssn. Yes {
  "title": "TheM.onboarding.client.ssn",
  "type": "string",
  "description": "Gets (returns) or sets the client
ssn.",
  "examples": [
    "123456789"
  ],
  "default": "",
  "nullable": false
}
document document Yes {
  "type": {
    "title":
"TheM.onboarding.client.document.type",
    "type": "string",
    "description": "Gets (returns) or sets the client
document type.",
    "examples": [
      "US driving license"
    ],
    "default": false
  },
  "number": {
    "title":
"TheM.onboarding.client.document.number",
    "type": "string",
    "description": "Gets (returns) or sets the client
document number (DL number, SSN number, etc.).",
    "examples": [
      "99999999"
    ],
    "default": false
  },
  "issued": {
    "title":
"TheM.onboarding.client.document.issued",
    "type": "string",
    "description": "Gets (returns) or sets the client
document issue date.",
    "examples": [
      "10052019"
    ]
  },
  "expires": {
    "title":
"TheM.onboarding.client.document.expires",
    "type": "string",
    "description": "Gets (returns) or sets the client
document expiration date.",
    "examples": [
      "08042029"
    ],
    "default": false
  },
  "issuingState": {
    "title":
"TheM.onboarding.client.document.issuingState
",
    "type": "string",
    "description": "Gets (returns) or sets the issuing
state of the client document.",
    "examples": [
      "PA"
    ]
  },
  "raw": {
    "title":
"TheM.onboarding.client.document.raw",
    "type": "object",
    "description": "Gets (returns) or sets the client
raw document data.",
    "examples": [
      {}
    ]
  },
  "nullable": false
}
languageCode Gets (returns) or sets the client languageCode. No {
  "title":
"TheM.onboarding.client.languageCode",
  "type": "string",
  "description": "Gets (returns) or sets the client
languageCode.",
  "examples": [
    "en"
  ],
  "default": "en"
}

Methods

Method Name Parameter Descriptions Description Example
doSave
[]
Saves onboarding data in local storage. Normally, there is no need to use this method as the framework knows automatically when to save and when to load the data to and from local storage. Returns true. TheM.onboarding.doSave();
doLoad
[]
Loads onboarding data from local storage and returns a boolean value to indicate success. On success, a(n) 'modelBank onboarding ready' event will occur.Normally, there is no need to use this method as the framework knows automatically when to save and when to load the data to and from local storage. TheM.onboarding.doLoad();
doConnectSocket
[]
Opens a socket connection, enabling bidirectional, event-based communication. TheM.onboarding.doConnectSocket();
doSetClient
[
{
"title": "given",
"type": "string",
"nullable": false,
"example":
"demo_uoiuqwehflkipahgoqq"
}
]
Sets the given presegment and creates a blank TheM.onboarding.client object according to the given presegment. Returns the given presegment string. TheM.onboarding.doSetClient("demo_uoiuqwehflkipahgoqq");
doSendData
[]
Sends the prospect onboarding data to the server. Returns true. TheM.onboarding.doSendData();
doSendDataGeneric
[
{
"title": "given",
"type": "object",
"nullable": false,
"example": {
"type": "adult account
recovery",
"deviceData": {
"data": {
"platform": "android"
},
"deviceTag": "my_deviceTag",
"platform": "android_v1",
"pushMessToken":
"somePushMessageToken"
},
"email":
"testemail@email.test",
"mobile": "5556667777"
}
},
{
"title": "target",
"type": "object",
"nullable": true,
"example": {}
}
]
Sends a generic prospect request of a specified type, such as adult account recovery, adult account recovery confirm, adult2 signup, etc. The properties of the given object are dependent on the generic request type. The optional target property is an object in which the results of the generic request can be stored. Returns true. TheM.onboarding.doSendDataGeneric(
  {
   "type": "adult account recovery",
   "deviceData": {
   "data": {
   "platform": "android"
   },
   "deviceTag": "my_deviceTag",
   "platform": "android_v1",
   "pushMessToken": "somePushMessageToken"
   },
   "email": "testemail@email.test",
   "mobile": "5556667777"
  }
,
  {}
);
doRegister
[
{
"title": "given",
"type": "object",
"nullable": true,
"properties": {
"presegment": {
"type": "string",
"nullable": true
},
"pin": {
"type": "string",
"nullable": true
}
},
"example": {
"presegment":
"demo_uoiuqwehflkipahgoqq",
"pin": "1234"
}
}
]
Creates an AFiUserId on the server end, creates and stores (in local storage) a server secret for device log in, and is the last step in the process of converting an idle user/prospect into an ampliFi user. Returns a boolean indicating success (true) or failure (false). TheM.onboarding.doRegister(
  {
   "presegment": "demo_uoiuqwehflkipahgoqq",
   "pin": "1234"
  }
);