Configuration

App configuration

Learn how to setup the overall settings of your extension.

The application configuration is set at apps/extension/src/config/app.ts. This configuration stores some overall variables for your application.

This allows you to host multiple apps in the same monorepo, as every application defines its own configuration.

The recommendation is to not update this directly - instead, please define the environment variables and override the default behavior. The configuration is strongly typed so you can use it safely accross your codebase - it'll be validated at build time.

apps/extension/src/config/app.ts
import { env } from "~/lib/env";
 
export const appConfig = {
  theme: {
    mode: env.PLASMO_PUBLIC_THEME_MODE,
    color: env.PLASMO_PUBLIC_THEME_COLOR,
  },
} as const;

For example, to set the extension default theme color, you'd update the following variable:

.env.local
PLASMO_PUBLIC_THEME_COLOR="yellow"

Do NOT use process.env!

Do NOT use process.env to get the values of the variables. Variables accessed this way are not validated at build time, and thus the wrong variable can be used in production.

Last updated on

On this page

No Headings
Ship your startup everywhere. In minutes.Get TurboStarter