Get Idenity
by passbird
HTML
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<!--
Import metakeep sdk.
You can also import npm package if you are using node for building website
e.g.
npm install metakeep@2.2.2
require(metakeep)
-->
<script src="https://cdn.jsdelivr.net/npm/metakeep@2.2.2/lib/index.js" integrity="sha256-XwEVfJ47JrjxB4a8Hyym7/kwX23rmtA1ZW6hbdCW090=" crossorigin="anonymous"></script>
</head>
</html>
JavaScript
/* Init SDK */
const sdk = new MetaKeep({
/* Idenity app id to configure UI */
appId: "8020c544-505b-4f40-b905-e5983b8515fc",
});
/* Call SDK. It returns a promise which returns when the operation succeeds.
Otherwise throws an error.
*/
async function getIdentity() {
try {
const getIdentityResponse = await sdk.getWallet();
console.log("getIdentity successful");
console.log(getIdentityResponse);
} catch (err) {
console.log("Error when trying to get the identity");
console.log(err.message);
}
}
getIdentity();