Building your own loader
Fatima is completely agnostic on how you load your secrets.
There's currently some built-in loaders that you can use, but I will show you how to create your own.
Do not proceed on your own with these providers
Unless you know what you're doing, I highly recommend using the built-in loaders for the following providers:
- Vercel
- Trigger.dev (the extension is the hard part)
How the load object works
Inside your env.config.ts
there's an available load
key that you can fill with an object of the following type:
This means you can pass multiple loaders for specific environments based on the environment key.
When chain loading your load functions, Fatima will execute them in order, and progressively merge the results, so what's loaded before will be available for the next loader.
The development key is mandatory, it will be used when running fatima dev
.
And yeah, this means you can load secrets from any source, .env or cloud.
Creating a custom load function with the InfisicalSDK
Info
Fatima alredy comes with a built-in infisical loader, this is just an example.
We will be using the built-in dotenv
loader to load from .env
. It is just a dumb wrapper around dotenv
.
Any loader will work as long as it returns a UnsafeEnvironmentVariables
object.