Learn how to configure secrets and environment variables in VibeKit
VibeKit allows you to securely pass environment variables to your sandbox environment through the secrets configuration. This guide explains how to configure and manage these secrets.
Secrets in VibeKit are environment variables that get passed to the sandbox where your code executes. They are configured through the optional secrets object when initializing the VibeKit class.
export type SecretsConfig = { /** Environment variables to be passed to the sandbox */ [key: string]: string;};
Once configured, these secrets are available as environment variables in your sandbox:
// In your generated code running in the sandboxconst databaseUrl = process.env.DATABASE_URL;const stripeKey = process.env.STRIPE_SECRET_KEY;// Use them in your applicationconst db = new Database(databaseUrl);const stripe = new Stripe(stripeKey);