Skip to main content Link Menu Expand (external link) Document Search Copy Copied

Configuration

Table of contents

  1. Overview
  2. specs
  3. options

Overview

ParamDescriptionRequiredDefault
specsAn object that specifies the format of required vars.No 
optionsAn (optional) object, which supports the following key:No 
options.reporterPass in a function to override the default error handling and console output.No 

specs

For further information take a look at the official documentation of envalid.

// nuxt.config.js
import { bool, str } from 'nuxt-envalid';
export default {
  buildModules: ['nuxt-envalid'],
  envalid: {
    specs: {
      TITLE: str(),
      SUBTITLE: str({ default: 'subtitle' }),
      IS_PUBLIC: bool({ default: false }),
    },
  },
};

options

For further information take a look at the official documentation of envalid.

// nuxt.config.js
export default {
  buildModules: ['nuxt-envalid'],
  envalid: {
    options: {
      reporter: ({ errors, env }) => {
        console.log(errors, env);
      },
    },
  },
};