# Client
# Parameters
-
options
Object-
options.server
string Server address, defaults to https://api.mpin.io -
options.projectId
string MIRACL Trust Project ID -
options.seed
string Hex encoded random number generator seed -
options.deviceName
string Name of the current device -
options.userStorage
Object Storage for saving user data -
options.oidc
Object Parameters for initializing an OIDC auth session -
options.cors
bool Enable CORS requests if set to ’true’ -
options.requestTimeout
number Time before a HTTP request times out in miliseconds -
options.applicationInfo
string Sets additional information that will be sent via X-MIRACL-CLIENT HTTP header
-
# setAccessId
Set the access(session) ID
# Parameters
accessId
string
# fetchAccessId
Make a request to start a new session and fetch the access(session) ID
# Parameters
userId
string The unique identifier of the user that will be authenticating (not required)callback
function (Error, Object)
# fetchStatus
Request for changes in status
# Parameters
# sendPushNotificationForAuth
Start the push authentication flow
# Parameters
userId
string The unique identifier of the user that will be authenticatingcallback
function (Error, Object)
# sendVerificationEmail
Start the verification process for a specified user ID (must be email)
# Parameters
# getActivationToken
Finish the verification process
# Parameters
verificationURI
string The URI received in the email containing the verification codecallback
function (Error, Object)
# register
Create an identity for the specified user ID
# Parameters
userId
string The unique identifier of the useractivationToken
string The code received from the verification processpinCallback
function Called when the PIN code needs to be enteredcallback
function (Error, Object)
# authenticate
Authenticate the user with the specified user ID
# Parameters
userId
string The unique identifier of the useruserPin
string The PIN associated with the userIdcallback
function (Error, Object)
# authenticateWithQRCode
Authenticate the user for the session specified by the qrCode parameter
# Parameters
userId
string The unique identifier of the userqrCode
string The QR code URL that initiated the authenticationuserPin
string The PIN associated with the userIdcallback
function (Error, Object)
# authenticateWithAppLink
Authenticate the user for the session specified by the appLink parameter
# Parameters
userId
string The unique identifier of the userappLink
string The app link that initiated the authenticationuserPin
string The PIN associated with the userIdcallback
function (Error, Object)
# authenticateWithNotificationPayload
Authenticate the session specified by the push notification payload
# Parameters
# generateOTP
Fetch an OTP for the specified user ID
# Parameters
userId
string The unique identifier of the useruserPin
string The PIN associated with the userIdcallback
function (Error, Object)
# generateQuickCode
Fetch a registration (bootstrap) code for the specified user ID
# Parameters
userId
string The unique identifier of the useruserPin
string The PIN associated with the userIdcallback
function (Error, Object)
# sign
Create a cryptographic signature of a given message
# Parameters
userId
string The unique identifier of the useruserPin
string The PIN associated with the userIdmessage
string The message that will be signedtimestamp
number The creation timestamp of the messagecallback
function (Error, Object)
# Users
User management utility. Initialized by Client
# Parameters
# exists
Check if an user with the specified user ID exists
# Parameters
userId
string The ID of the user
Returns boolean
# is
Check if an user is in a specific state
# Parameters
Returns boolean Returns true if the state of the user matches the state argument
# get
Get a property of the user
# Parameters
Returns string The value of the user property. Will return undefined if property doesn’t exist
# list
List all identities
Returns Object
# remove
Remove an identity
# Parameters
userId
string The ID of the user