Primitives
UI Components
Evervault UI Components make it easy to collect or display cardholder data securely in the browser with our client-side SDKs.
The UI Components primitive includes two elements: Inputs and Reveal. Inputs is an iframe form which can be used to collect and encrypt card data. Reveal is an iframe container which can be used to decrypt and display encrypted card data.
UI Components are served within an iframe retrieved directly from Evervault’s PCI-compliant infrastructure, and all operations on card data occur within Evervault's PCI Compliant environment.
Adopting this approach for collecting or displaying card data can reduce your PCI DSS compliance scope to the simplest form (SAQ A Control Set), once integrated correctly.
UI Components are fully customizable and can be updated to match your design system with simple CSS configuration.
Inputs
Get up and running with Evervault Inputs in less than 5 minutes.
In this example, we will use one of our client-side SDKs. Before starting this tutorial, you'll need to sign up for an Evervault account and create an app.
Getting Started
To use Evervault Inputs, you will need to install either our JavaScript SDK or React.js SDK.
Integrate Evervault Inputs
Once installed, initialize the JavaScript SDK or React.js SDK with your Team ID and App ID, both of which can be found in the Evervault Dashboard.
Integrating Inputs is then as easy as creating an element in HTML or using the <EvervaultInputs />
component in React.js.
Encrypted card details will be returned to you in JSON format, so you can then pass it on to your backend without ever handling cardholder data in plaintext — reducing your PCI DSS compliance scope to the simplest form.
The output JSON will be structured like this:
Styling
Inputs can be customized to match your brand’s design system. Both the JavaScript and React SDK allow additional configuration for styling both the Evervault Inputs container as well as each <input>
within the container.
Supported settings
When passing a config object for customizing Inputs, the following key-value pairs are supported.
The color CSS property applied to the ::placeholder CSS pseudo-element for inputs.
Will remove the CVV field from Inputs and show only the card number and expiry fields if this key is present.
Default theme
Set theme
to default
to use the Default theme for Inputs.
Minimal theme
Set theme
to minimal
to use the Minimal theme for Inputs.
Material theme
Set theme
to material
to use the Material theme for Inputs.
Localization
The iFrame can be localized on initialization by providing a set of labels in the config. The labels can then be updated as required using the setLabels
method in the JavaScript SDK or React.js SDK.
Reveal
Getting Started
Displaying card data to a user while minimizing PCI Compliance scope is possible with Evervault's Reveal UI Component. To use Reveal, you'll need to create an Inbound Relay that points at your API. The endpoint should return an encrypted card data payload in the json
format outlined below. The request
parameter of Reveal receives a Request
object pointing at the Inbound Relay URL, along with the Authentication headers required to access the endpoint. Inbound Relay will automatically decrypt the card data before it arrives at the Reveal iframe.
It is important that the endpoint that you create sets the applicable CORS headers so that it can be accessed from the Reveal iFrame. Otherwise your requests will fail.
Styling
When passing a config object to style Reveal, the following key-value pairs are supported.
By default, the Reveal iframe doesn't include labels. Setting any of the label config options will add a label to the relevant section.
Adds a label above the card number, it will display the text passed in to this option field.
Adds a label above the expiration date, it will display the text passed in to this option field.
Adds a label above the security code, it will display the text passed in to this option field.
Advanced styling
The styling options above are designed to solve for the most common styling needs of Evervault users. However, we recognize that additional styling parameters are often required.
To apply more granular styling, you can add CSS attributes to each element of the Reveal component using the customStyles
parameter. The diagram below shows the arrangement of DOM elements within the iframe where CSS styles can be applied.
To minimize PCI Compliance scope, and to ensure that untrusted code can't run within the Reveal iframe, we don't allow any custom CSS to use the url()
function. Any CSS values using url()
will be removed from the config.
To style an element, add the customStyles
argument to the config object. customStyles
is an object where the keys are the elements of the DOM that you can style, and the values are objects containing all of the custom styles for a given DOM element.
For instance, consider a scenario where you need to create a 40px
margin between the topRow
and the bottomRow
, and also italicize the CVV. In this case, the following parameters would be applied:
Error handling
Because Reveal fetches card data from your server via Inbound Relay, it's structured to provide your application with insights into any errors that occur. This design allows you to determine the appropriate response of your application when there's a failure in retrieving card details. To understand how to manage errors using our React and Javascript SDKs, see the examples below.
Security
Evervault Inputs and Reveal are served through an iframe hosted on Evervault's compliant (PCI DSS Level 1) infrastructure.
Evervault is responsible for the security of the servers providing the iframe, meaning your cardholder data environment is reduced to the smallest size possible.
All credit card data is encrypted client-side using the Web Crypto API, so no cardholder data leaves your user's device without being encrypted using Evervault Encryption.