SST
Configure SST serverless functions for @cipherstash/stack by excluding it from esbuild bundling and installing it into the Lambda deployment artifact.
When deploying @cipherstash/stack in serverless functions with SST, you need to exclude the package from esbuild bundling and install it into the Lambda deployment artifact.
Configure nodejs.esbuild.external and nodejs.install in your sst.config.ts:
{
nodejs: {
esbuild: {
external: ["@cipherstash/stack"],
},
install: ["@cipherstash/stack"],
},
}The external option prevents esbuild from bundling the package. The install option ensures it gets installed into the Lambda deployment artifact so it's available at runtime.
See the SST Function documentation for more details.
For other bundler configurations (webpack, esbuild, Next.js) and Linux deployment troubleshooting, see Bundling.
Bundling
Configure webpack, esbuild, Next.js, and SST to exclude the native @cipherstash/stack module from bundling, plus fixes for Linux deployment failures.
Testing
Test applications using @cipherstash/stack encryption with a dedicated workspace or mocked client, plus PostgreSQL integration tests and CI setup.