toc

JavaScript SDK

A full reference of our JavaScript SDK.

The Evervault JavaScript SDK is a toolkit for encrypting data in the browser.

Installation

Add this script tag immediately before the closing </body> tag:

html
<script src="https://js.evervault.com/v1" async></script>

Initialization

Once installed, initialize the JavaScript SDK with your team's unique ID found in the Settings.

javascript
const evervault = new Evervault('<YOUR_TEAM_ID>');

Reference

The Evervault JavaScript SDK exposes one function: evervault.encrypt()

evervault.encrypt()

evervault.encrypt() encrypts data for use in your Cages. To encrypt data in the Browser, simply pass an object or string into the evervault.encrypt() function. Store the encrypted data in your database as normal.

javascript
async evervault.encrypt(data: Object | String);
ParameterTypeDescription
dataObject or StringData to be encrypted