Web SDK

Configuration and lifecycle

Configure the modal, background styling, methods, completion, and errors.

Initialization

Call ZippyKycSdk.init() to prepare a session. The modal mounts on document.body and stays hidden until you call open().

Initialize

typescript
import { ZippyKycSdk } from "@zippykyc/web-sdk";

ZippyKycSdk.init({
  inquiryId: "147f10c6-d42c-4c31-9518-a14d582bde6b",
  environment: "staging", // "staging" | "production"
  theme: "light",
  language: "en",
  background: "rgba(255, 255, 255, 0.35)", // optional — panel only
  backgroundBlur: "12px", // optional — or false
  debug: false,
  onComplete: ({ inquiryId, referenceId }) => {
    console.log({ inquiryId, referenceId });
    // Session is torn down. Call init() again for a new inquiry.
  },
  onClose: () => {
    console.log("user dismissed the modal");
    // Session stays alive — call open() to show again.
  },
  onError: ({ code, message }) => {
    console.error(code, message);
  },
});

ZippyKycSdk.open();

Options

Initialization options

NameTypeRequiredDescription
inquiryIduuidRequiredInvitation / inquiry identifier.
environmentstaging | productionOptionalHosted environment. Defaults to "staging" when omitted.
themestringOptionalOptional theme forwarded to the KYC experience.
languagestringOptionalOptional BCP-47 language tag.
backgroundhex | rgb() | rgba()OptionalModal panel fill color. Defaults to rgba(255, 255, 255, 0.18). Does not change the page overlay.
backgroundBlurCSS length | falseOptionalModal panel blur. Pass false to disable. Defaults to "12px".
showCloseButtonbooleanOptionalShows the X button on the panel. Defaults to true.
closeOnBackdropClickbooleanOptionalDismisses when the page overlay is clicked. Defaults to true.
debugbooleanOptionalEnables console diagnostics. Keep disabled in production.
onCompletefunctionOptionalCalled after verification completes and the SDK tears down the session.
onClosefunctionOptionalCalled after close() / X / overlay / Escape. Session stays alive.
onErrorfunctionOptionalCalled for runtime SDK failures.

Panel background

background and backgroundBlur style the modal panel only. The page overlay is a fixed dim and is not customizable.

Accepted background formats

NameTypeDescription
Hex3 / 4 / 6 / 8 digits#fff, #fff8, #ffffff, #ffffff2e
rgb() / rgba()CSS functionrgb(255, 255, 255) or rgba(255, 255, 255, 0.35)

Example

typescript
ZippyKycSdk.init({
  inquiryId: "...",
  background: "#ffffff2e", // or "rgba(255, 255, 255, 0.35)"
  backgroundBlur: "16px", // or false
});

Methods

NameTypeDescription
init(options)voidPrepares the session (hidden until open()). Re-init only after verification completes.
open()voidShows the modal. Safe to call again after dismiss.
close()voidHides the modal only; session stays alive; calls onClose.
version()stringReturns the SDK version string.

Callbacks

NameTypeDescription
onComplete({ inquiryId?, referenceId? })callbackVerification finished; session already torn down.
onClose()callbackUser dismissed with close() / X / overlay / Escape; session still alive.
onError({ code, message })callbackRuntime failures such as READY_TIMEOUT or IFRAME_LOAD_ERROR.

Completion payload

typescript
type VerificationCompletePayload = {
  inquiryId?: string;
  referenceId?: string | null;
};

Browser security

  • Serve the integrating application over HTTPS.
  • Allow the Zippy KYC iframe origin in frame-src. Contact Zippy for the hosts to allowlist for your environment.
  • If you load the SDK from a CDN, allow that origin in script-src.
  • Camera and microphone flows need an appropriate Permissions Policy (the SDK sets a default iframe allow attribute).
  • Keep SDK debug logging disabled in production.