BlockchainID is a simple OAuth2 to request personal and verified data from OriginalMy users.
yarn add @originalmy/blockchainid-qrcode-plugin
Or
npm install @originalmy/blockchainid-qrcode-plugin
const BlockchainID = require("@originalmy/blockchainid-qrcode-plugin");
Or
import BlockchainID from "@originalmy/blockchainid-qrcode-plugin";
Or
<script src="https://unpkg.com/@originalmy/blockchainid-qrcode-plugin/dist/blockchainid.js"></script>
On JavaScript:
const blockchainID = new BlockchainID({
companyId: YOUR_COMPANY_ID,
});
blockchainID.onAuthenticate = function (nonce) {
console.log("Authentication OMyID", nonce);
console.log(
"Make a request to your backend here sending the nonce to get user infos"
);
};
blockchainID.onExpire = function () {
console.log("Link OMyID expired");
};
blockchainID.onCancel = function () {
console.log("Canceling...");
};
On HTML:
<div id="blockchainID"></div>
Element where BlockchainID button will stay.
CompanyID given by OriginalMy API.
List of informations to require from user. See the complete list in documentation.
Values: dialog | body | kiosque | link (default: dialog)
QR code display type
Values: originalmy (default)
Scheme defined to open the app
Image URL that stay in button left side
Button text
If you desire to show OriginalMy icon on QR code (default: true)
Image URL that stay on dialog top
Values: String en (default) | pt
Plugin language
Values: String #000000 (default)
Dialog close button color
Override button style
Override button icon style
Override button text style
Override QR code style
Override QR code container style
Override dialog style
Override dialog backdrop style
Override dialog logo style
Override dialog close button style
Texts translations
{
"en": {
"buttonText": "..."
},
"pt-BR": {
"buttonText": "..."
}
}
Function to be called when the user scan the QR code and accept the required data.
Function to be called when the QR code expires.
Function to be called when user closes the dialog and cancel authentication.
Function to be called when starts Blockchain session to get login URL.
Any bug, error and doubt [email protected]
OriginalMy. All rights reserved