Integration and Usage

ONT Login web component UI SDK for JavaScript

Before getting started, please make sure to:

  • implement the API as specified

  • check web component compatibility here

​Please check out the front-end JavaScript SDK is you want to build a custom UI.

Example Apps

Integration and Usage

via NPM package

npm i ontlogin-ui
import "ontlogin-ui";
<ont-login
  url_of_get_challenge="server/requestChallenge"
  url_of_submit_response="server/submitChallenge"
/>

via js bundle

<ont-login
  id="ontlogin"
  url_of_get_challenge="server/requestChallenge"
  url_of_submit_response="server/submitChallenge"
/>
<script src="ontloginui.min.js"></script>
<script>
  // add event listener to custom event
  const target = document.querySelector("#ontlogin");
  target.addEventListener("success", (e) => {
    console.log(e.detail);
  });
  target.addEventListener("error", (e) => {
    console.log(e.detail);
  });
  target.addEventListener("cancel", (e) => {
    console.log(e.detail);
  });
</script>

Last updated