Skip to main content
An Angular app compiles to static files that run in the browser, so it has no process.env at runtime and every value it ships is public. Inject configuration at build time and keep real secrets on a server.

Local development and builds

Angular reads configuration from src/environments/environment.ts, which is baked in when the app is built. To use Enkryptify values, run Angular under ek run and generate that file from the injected variables. A small script keeps values out of source control:
scripts/set-env.ts
Generate the file before serving or building:
Anything compiled into an Angular bundle is visible in the browser. Only inject non-sensitive configuration this way; call a backend for anything that needs a real secret.

Deploying

Run the build under ek run so your configuration is present, then deploy the static output. If your host builds the app, use a sync to provide those variables there. For an Angular app with a Node SSR server, the server reads secrets directly from process.env.