React
Getting Started
Our React SDK is distributed via npm and can be installed using your preferred package manager.
Once installed, Initialize the SDK by wrapping your application with the EvervaultProvider component.
Encrypting Data
Once you've added the <EvervaultProvider>, you can access the useEvervault() hook in its children. The useEvervault() hook returns an initialized instance of the JavaScript SDK, which includes the encrypt() function. The encrypt() function can be used to encrypt plaintext data in your application.
Components
EvervaultProvider
Sets up a client for interacting with Evervault. You must provide a teamId and appId to the provider.
Props
The unique identifier for your Team.
The unique identifier for your App.
A callback function that is called if the SDK fails to load. Use the isScriptLoadError utility to determine the cause of the error.
The timeout in milliseconds for the SDK to load. Defaults to
15000(15s).
The EvervaultProvider accepts a ref that exposes a reload() method that you can use to reload the script if it fails.
Ref Methods
Attempts to reload the Evervault script. Typically called in response to an
onLoadErrorevent.
Card
The Card Component allows you to collect and encrypt card data in a completely PCI-compliant environment. See Card Collection for more information.