An inline function for converting any existing function into a Cage.
evervault.cagify() is an inline function that lets you instantly convert any existing function into a Cage. It is only available in our Node.js SDK.
Simply wrap an existing function in
cagify() along with a name for the Cage, and our SDK will automatically deploy your source code to a Cage.
cagify() requires the CLI to be installed in your local development environment. It uses our CLI to automatically deploy Cages under the hood.
It will also generate a
cage-lock.json file in the root of your project which must be committed to source control and included in your production codebase. The
cage-lock.json file keeps track of any source code changes, prevents code tampering, and ensures your app is always calling the correct version of the Cage.
All updates to a Cage deployed via
cagify() will be tracked and logged to an individual user within your team.
It is important to note that
cagify() functions will not have access to any resources outside of the function scope itself, with two exceptions:
- Environment Variables
- NPM Packages
Environment variables will automatically be encrypted in your server and injected to the Cage at runtime. They will be available in the
process.env object, as normal.
npm packages must be required within the function itself.
cagify() will automatically detect any packages included in your function and install them during the deployment flow.
Note: if your function is synchronous,
cagify() will automatically convert it to an asynchronous function as it requires an external network call.
For more information, see the Node.js SDK reference.
Here is an example of a typical