Using the javascript library
Using the javascript library is optional but recommended if you are new to Presence or would like to opt for the simplest solution. The library gives you access to a PresenceUser
object that exposes several useful functions that handle API requests, data conversions and formatting.
Import the library
The Presence library is available through the below CDN. Presence is not yet available on NPM.
Browsers will only allow Web Authentication over HTTPS so ensure your environment is running on HTTPS.
Instantiating a PresenceUser
PresenceUser.registerWebAuth
PresenceUser.loginWebAuth
Advanced options
If you want to use your own back-end Web Authentication library, you can override the API address. By default this points to the Presence API at https://presence.mioko.tech. The override must be specified before the script is imported. You will need to create your own endpoints for miokoApiDomain + '/api/webauth-register-init', miokoApiDomain + '/api/webauth-register-submit', miokoApiDomain + '/api/webauth-login-init', miokoApiDomain + '/api/webauth-login-submit'.
Last updated