Getting Started
Quickstart
Get started with fatima in minutes.
Init CLI (recommended)
Manual Setup, takes 2 minutes.
Installation
Configuration file
Let's load some stuff from .env
, declare a publicPrefix
and then validate everything with zod
.
First create your file env.config.ts
file:
For more information about the environment
function, check Environment Mixing.
Generate
Path Alias
Make sure you can import env
from anywhere in your project without big relative imports:
Add validation
Validate
Go on and use it
Run your app with fatima
This will load, generate and inject the environment variables into your app.
Add env to your .gitignore
You should gitignore your env
and always generate it before building/installing.
Overview
At the end of the setup, your project should look like something around this:
env.config.ts
env.ts
package.json
tsconfig.json