Skip to main content

Environment

Kazzle injects a small set of platform variables into app processes. Your own credentials come from the vault through kazzle.config.ts.

Process variables

VariableDescriptionExample
PORTThe port your process should listen on3000
HOSTThe host to bind to0.0.0.0
KAZZLE_API_URLBase URL used by Kazzle runtime helpershttps://api.kazzle.app
PORT, HOST, and KAZZLE_API_URL are set for process components. Kazzle does not create API keys automatically for app processes; add explicit credentials only when your app actually needs them. Your process should bind to HOST:PORT. Kazzle handles preview routing and production domains on top of that.

Sibling component URLs

When an app has multiple components, Kazzle can inject URLs that let one component reach another:
VariableDescription
KAZZLE_APP_COMPONENT_{NAME}_URLURL for a sibling component at runtime
The name comes from the component’s name field: uppercased, non-alphanumeric characters become underscores. A sibling named API Server becomes KAZZLE_APP_COMPONENT_API_SERVER_URL. These URLs point to the deployed sibling when one exists. Otherwise they point to the current development address for that sibling component.

App credentials

App credentials reach a component through a secret collection + environment. Store the secret in the vault with the name you want as the env var key (for example KAZZLE_API_KEY), then point the component at that collection + environment:
export default defineConfig({
  components: [
    {
      name: 'server',
      type: 'process',
      path: './server',
      env: {
        collection: 'my-app',
        environment: 'default'
      }
    }
  ]
});
Use KAZZLE_API_KEY for calls to Kazzle’s /ai/* endpoints from a generated app. Never expose private keys through VITE_*; those values are bundled into browser code.