Hanzo
PlatformHanzo KMSIntegrationsFrameworks

Bun

How to use Hanzo KMS to inject environment variables and secrets into a Bun app.

Prerequisites:

Initialize Hanzo KMS for your Bun

# navigate to the root of your of your project 
cd /path/to/project

# then initialize kms
kms init

Start your application as usual but with Hanzo KMS

kms run -- <your application start command>

# Example
kms run -- bun run dev

Bun environment variables can be called as either Bun.env.SECRET or process.env.SECRET. We also recommend you check this more in-depth guide to environment variables in Bun.

How is this guide?

Last updated on

On this page