VerifymeDocs

@cubis/verifyme

The official JavaScript / TypeScript SDK — server, browser, React and Vue.

npm i @cubis/verifyme

Zero runtime dependencies (fetch + Web Crypto). Node 20+, Bun, Deno, Cloudflare Workers and browsers; ESM and CommonJS, fully typed.

ImportWhereAPI key
@cubis/verifymeserveryes
@cubis/verifyme/browserany web pageno
@cubis/verifyme/reactReact 18+no
@cubis/verifyme/vueVue 3.3+ / Nuxtno

Client

import { Verifyme } from "@cubis/verifyme"

const verifyme = new Verifyme({
  apiKey: process.env.VERIFYME_API_KEY!,
  baseUrl: "https://verifyme.cubis.tech", // or your instance
  timeout: 15_000, // ms per request
})
// or Verifyme.fromEnv() — reads VERIFYME_API_KEY and VERIFYME_URL

Create one client and reuse it.

MethodDoes
send(input)Send a code → { token, exp, trace_id }
check({ token, code }){ success }
status(token){ status, target, created_at }
widget.createSession(input){ session_id, widget_token, expires_at }
widget.redeem(proof){ verified, session_id, target, client_reference, … }
otp.generate(input) / otp.verify(input)TOTP (authenticator apps)

Every method takes { signal } as a last argument for cancellation.

Errors

import { VerifymeError } from "@cubis/verifyme"

try {
  await verifyme.send({ target })
} catch (e) {
  if (e instanceof VerifymeError) {
    e.status // 400, 401, 403, 429, 5xx, or 0 for a network failure
    e.message // the API's `detail`
    e.retryAfter // seconds, on 429
    e.traceId // paste into the console to find the request
    e.retryable // 429, 5xx or transport
  }
}

Browser and frameworks

import { openWidget, loadWidgetScript, mountWidget } from "@cubis/verifyme/browser"
import { VerifyWidget, useVerifyWidget } from "@cubis/verifyme/react"
import { VerifyWidget, useVerifyWidget } from "@cubis/verifyme/vue"

See Widget → Frameworks. mountWidget returns a handle synchronously — the building block for your own framework binding.

Webhooks

parseWebhook({ payload, signature, secret }) returns the typed event or throws; verifyWebhook(...) returns a boolean. See Webhooks.

On this page