DMNO quickstart
-
Setup
dmno
in your projectRun this command in the root of your project:
This will create a
.dmno
folder in the root of your project with aconfig.mts
file, including config items in yourschema
that we automatically imported from.env
files. If in a monorepo, any additional services of your choice will get their own.dmno
folders and associated files. Each.dmno
folder looks something like this:Directory/
Directory.dmno
Directory.typegen/ (generated types)
- …
- .env.local (your local overrides and sensitive values)
- config.mts (your config schema)
- tsconfig.json (dmno specific tsconfig)
- … the rest of your folders
-
Run
dmno resolve
in watch modeThis will give you instant feedback while you author your config schema.
-
Write your schema
The config schema and other settings live in the
.dmno/config.mts
files.dmno init
does its best to scaffold out the initial version of this schema based on your existing.env
files. Updating each item with a description,required
, andsensitive
is a great next step. You can then improve your schema over time, adding validations, and setting values from within the schema itself.Your initial should look something like this:
Check out the schema guide for full details.
And if you would like more information on how we use
.env
files check out `.env’ file guide -
Configure framework specific integrations
We provide drop-in integrations for many popular frameworks, and more are in the works.
dmno init
is smart enough to install the relevant integrations for each service. You can also read more about each integration on their respective pages and update them as needed.In this case of Astro or Vite, the integrations should work out of the box. In other cases, like Node.js or Next.js, you will need to update your
package.json
scripts to usedmno run
so that your resolved config is passed to the script in question. -
Use
DMNO_CONFIG
to access your configWe recommend migrating to
DMNO_CONFIG
as it provides helpful improvements like TypeScript autocompletion and IntelliSense.For example:
You could continue to use
process.env
/import.meta.env
to access your config and still benefit from DMNO’s validation logic. But,DMNO_CONFIG
gives you the full benefits of DMNO.