Skip to main content

Elements SDK

@ozura/elements is Ozura’s browser SDK for embedding secure payment input fields in your own UI. Each field runs in an isolated iframe hosted at elements.ozura.com — raw card and bank data never exist in your JavaScript bundle, your DOM, or your server logs.

Key Concepts

Isolated iframes

Every element (card number, CVV, account number, etc.) is rendered inside a cross-origin iframe. Your page can style and position the iframe, but it cannot read the value inside it. Only the Ozura tokenizer — also running in a same-origin iframe — can access the raw data.

Tokenizer frame

A hidden <iframe> is mounted alongside your input elements. When you call createToken() or createBankToken(), the input frames pass their values to the tokenizer frame via postMessage, and the tokenizer frame POSTs directly to the Vault API. You receive a token — never the raw data.

PCI scope reduction

Because sensitive data never reaches your JavaScript or your server, your PCI DSS surface area is significantly reduced. You only handle vault tokens.

Package Details

Package name@ozura/elements
npmnpm install @ozura/elements
CDN (ESM)https://elements.ozura.com/oz-elements.esm.js
CDN (UMD)https://elements.ozura.com/oz-elements.umd.js
React entrypoint@ozura/elements/react
TypeScriptFull type definitions included

What’s in the Box

ExportDescription
OzVaultMain SDK class. Manages elements, the tokenizer frame, and credentials.
OzElementReturned by createElement() and createBankElement(). Exposes .mount(), .on(), .destroy(), etc.
OzErrorError class thrown by createToken() and createBankToken(). Has .message and .errorCode.
normalizeCardSaleErrorUtility to map vault error strings to user-friendly messages.
OzElementsReact context provider (from @ozura/elements/react).
useOzElementsReact hook for createToken, ready state, and element access (from @ozura/elements/react).
OzCardNumber, OzExpiry, OzCvvPre-built React card field components (from @ozura/elements/react).
OzCardCombined card component rendering all three card fields (from @ozura/elements/react).

SDK Pages