Check out the docs for more information on how to use DMNO with Vercel.
If you have any questions, please reach out to us on Discord.
This package provides a set of prebuilt types and environment variables for Vercel.
npm add @dmno/vercel-platform
import { defineDmnoService, switchBy, pickFromSchemaObject } from 'dmno';
import { VercelEnvSchema } from '@dmno/vercel-platform';
export default defineDmnoService({
schema: {
...pickFromSchemaObject(VercelEnvSchema, 'VERCEL_ENV', 'VERCEL_GIT_COMMIT_REF'),
// example of adding more specificity/control over env flag using vercel's env vars
APP_ENV: {
value: () => {
if (DMNO_CONFIG.VERCEL_ENV === 'production') return 'production';
if (DMNO_CONFIG.VERCEL_ENV === 'preview') {
if (DMNO_CONFIG.VERCEL_GIT_COMMIT_REF === 'staging') return 'staging';
else return 'preview';
}
return 'development';
},
},
},
});