CORE CONCEPTS

Environment Variables

Rasengan.js comes with built-in support for environment variables, which allows you to do the following:

  • Use .env to load environment variables
  • Bundle environment variables for the browser by prefixing with RASENGAN_

Load Environment Variables

Rasengan.js has built-in support for loading environment variables from .env into import.meta.env.

.env
txtRASENGAN_API_URL=https://api.example.com RASENGAN_API_KEY=abc123 RASENGAN_PORT=3000

Access to Environment Variables

Using environment variables in your application is easy. You can access them like follow:

src/app/home.page.js
jsimport.meta.env.RASENGAN_API_URL; // 'https://api.example.com' import.meta.env.RASENGAN_API_KEY; // 'abc123' import.meta.env.RASENGAN_PORT; // '3000'
TypeScript
Modules Aliases