@dmno/vercel-platform
v0.0.3
Published
tools to use dmno with vercel
Downloads
87
Readme
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.
@dmno/vercel-platform
This package provides a set of prebuilt types and environment variables for Vercel.
Installation
npm add @dmno/vercel-platform
Example Usage
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';
},
},
},
});