JavaScript SDK

A full reference of our JavaScript SDK.

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

You can use our frontend SDKs to encrypt data — rather than with Relay — and still send it to a third-party via Relay. Encrypting with our frontend SDKs is best for developers who want to avoid the network latency of Relay and/or want to avoid sending plaintext data to an Evervault endpoint.

You don’t need to change your database configuration. You can store Evervault-encrypted data in your database as you would the plaintext version.


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

<script src="" async></script>


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

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


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


evervault.encrypt() encrypts data for use in your Cages and through Relay. 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.

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