API Reference
constructor(options)
This function creates and renders MobbSign in a given HTML element. It returns a configured instance in a Promise. You should use that instance to load comments.
✅ This is right
new MobbSign(config).then(mobbsign => mobbsign.load(docID));
❌ This is wrong
const mobbsign = new MobbSign(config); mobbsign.load(docID);
Parameters
Paremeter | Required | Type | Description |
---|---|---|---|
root | Yes | Element | HTML Element where MobbSign will be rendered. It should have a relative position with a fixed width and/or height |
endpoint | Yes | String | MobbSign Server API base URL. |
apiKey | Yes | String | MobbSign Server API Key. |
appID | Yes | String | MobbSign Server App ID. |
language | No | String | Language of the UI (valid values: es or en ). If not provided en is the default value. |
onDocumentLoaded | No | Function | Called everytime a document is loaded. |
onSignatureAcquired | No | Function | Called everytime a signature is acquired (drawn). Afterwards, the signature could be discarded or confirmed. |
onSignatureDiscarded | No | Function | Called everytime a user discards a signature. |
onSignatureConfirmed | No | Function | Called when a signature is confirmed by a user. This occurs befure the document is actually signed. |
onDocumentSigned | No | Function | Called when the document is signed by MobbSign. |
onError | No | Function | Called when an error occurs. The error will be provided as parameter. |
onDone | No | Function | Called when the user finishes the signing process. |
configPath | Yes | String | Relative path to the provided config.js file. |
libPath | Yes | String | Relative path to the provided lib/ folder. |
imgUrl | Yes | String | Path or URL to the provided img/ folder. |
localesUrl | Yes | String | Path or URL to the translations files. |
blockNoTactileDevices | No | Boolean | default true , block the use of MobbSign on non-touch screens |
onlyRead | No | Boolean | default false , to hide actions buttons and manage the document as read-only. |
signatureAcquisitionTimeout | No | Int | Timeout for wait since the user finish the signing, in milliseconds. Default 2000 . |
customization | No | Object | Customize toolbar action buttons. |
onlyFinishWhenEveryoneSign | No | Boolean | boolean flag, default false , to indicate if Finish button should only appears when all the signers of the document have signed. |
userToken | No | String | Only for BIOMETRIC_WITH_CERTIFICATE signature: if applies, user identification token in the documentation manager |
Returns
- A Promise which resolves to an instance of MobbSign.
load(documentID)
This function loads a document in a configured instance.
If you need to load several documents in a row, you should wait the end of previous loads:
✅ This is right
mobbsign.load(docID).then(() => mobbsign.load(otherDocID));
❌ This is wrong
mobbsign.load(docID); mobbsign.load(otherDocID);
Parameters
documentID
(string): MobbSign API document ID.
Returns
- A Promise which resolves when the document is loaded.