![Evervault](https://evervault.com/evervault.svg)
Evervault Node.js SDK
The Evervault Node.js SDK is a toolkit for encrypting data as it enters your server, and working with Cages. By default, initializing the SDK will result in all outbound HTTPS requests being intercepted and decrypted.
Getting Started
Before starting with the Evervault Node.js SDK, you will need to create an account and a team.
For full installation support, book time here.
Documentation
See the Evervault Node.js SDK documentation.
Installation
Our Node.js SDK is distributed via npm, and can be installed using your preferred package manager.
npm install --save @evervault/sdk
yarn add @evervault/sdk
Setup
To make Evervault available for use in your app:
const Evervault = require('@evervault/sdk');
const evervaultClient = new Evervault('<API-KEY>');
const encrypted = await evervaultClient.encrypt({ ssn: '012-34-5678' });
const result = await evervaultClient.run('<CAGE_NAME>', encrypted);
Reference
The Evervault Node.js SDK exposes three functions.
evervault.encrypt()
evervault.encrypt()
encrypts data for use in your Cages. To encrypt data at the server, 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);
Parameter | Type | Description |
---|
data | Object or String | Data to be encrypted. |
evervault.run()
evervault.run()
invokes a Cage with a given payload.
async evervault.run(cageName: String, payload: Object[, options: Object]);
Parameter | Type | Description |
---|
cageName | String | Name of the Cage to be run |
data | Object | Payload for the Cage |
options | Object | Options for the Cage run |
Cage Run Options
Options to control how your Cage is run
Option | Type | Default | Description |
---|
async | Boolean | false | Run your Cage in async mode. Async Cage runs will be queued for processing. |
version | Number | undefined | Specify the version of your Cage to run. By default, the latest version will be run. |
Enable outbound interception for specific domains
You may pass in an array of domains which you do want to be intercepted, i.e. requests sent to these domains will be intercepted, and hence will be decrypted. This array is passed in the decryptionDomains
option. Wildcards domains are supported.
const evervaultClient = new Evervault('<API-KEY>', {
decryptionDomains: ['httpbin.org', 'api.acme.com', '*.acme.com'],
});
Contributing
Bug reports and pull requests are welcome on GitHub at https://github.com/evervault/evervault-node.
Please see CONTRIBUTING.md for more details.
Feedback
Questions or feedback? Let us know.