Code examples

Verify button page

Standalone HTML page with a verify button.

A complete page with a verify button. Replace the button ID and publishable key with yours from Developers → Verify buttons, and serve it from a website on the button's allowed list.

verify.html
<!doctype html>
<html lang="en">
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <title>Verify your identity</title>
  <script async src="https://www.kaywhysee.com/embed/v1/verify-button.js"></script>
  <link rel="stylesheet" href="verify.css">
</head>
<body>
  <main class="card">
    <h1>One last step</h1>
    <p>We need to check your ID before you can send money. It takes about two minutes on your phone.</p>

    <kaywhysee-verify-button
      button-id="vb_..."
      publishable-key="pk_live_..."
      client-reference-id="user_1042"
      full-width="true">
    </kaywhysee-verify-button>

    <p class="small" id="status"></p>
  </main>
  <script src="verify.js"></script>
</body>
</html>
verify.js
document.addEventListener("kaywhysee:started", () => {
  document.getElementById("status").textContent =
    "Carry on on your phone. You can close this page when you're done.";
});
verify.css
body {
  font-family: system-ui, sans-serif;
  display: grid;
  place-items: center;
  min-height: 100vh;
  margin: 0;
  background: #f5f5f5;
}
.card {
  max-width: 24rem;
  padding: 2rem;
  border-radius: 1rem;
  background: #fff;
}
.small {
  font-size: 0.875rem;
  color: #666;
}
edit_note

Set client-reference-id from your server when you render the page, so each session carries your ID for the customer.

Was this page helpful?

Authorization

Your secret key stays in this tab: it is sent with this request only and never stored.

Body application/json

Response

Send the request to see the response.