GetConsent

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 [email protected]
    require(metakeep)
    -->
    <script src="https://cdn.jsdelivr.net/npm/[email protected]/lib/index.js" integrity="sha256-H/4oonNpLB80c5K9AOVmlBxkF9eS+fwKGd2p7otNfDE=" crossorigin="anonymous"></script>
  </head>

</html>

JavaScript

/* Init SDK */
const sdk = new MetaKeep({
  /* App id to configure UI */
  appId: "9cc98bca-da35-4da8-8f10-655b3e51cb9e",
});

/* Call getWallet. It returns a promise which returns when the operation succeeds.
Otherwise throws an error.
*/
async function getWallet() {
  try {
    const getWalletResponse = await sdk.getWallet();
    console.log("getWallet successful");
    console.log(getWalletResponse);
  } catch (err) {
    console.log("Error when trying to get wallet");
    console.log(err.message);
  }
}


getWallet();