Prism/Configuration

Configuration

What lives in config.json, the environment variables Prism reads and where everything else is set.

Prism keeps only what it needs to start in config.json. Everything else is stored in your database and changed from the dashboard.

WhereWhat
config.jsonSign-in secret, database connection, ports and public URLs.
Settings pageLanguage, console, branding, server URLs, SMTP, S3 storage, updates, sign-in and checkout.
Theme pageColours, fonts, store layout and the sign-in screen. See Storefront.
Configs pageSettings for each module.

The setup wizard fills in config.json for you. You only need to edit it to move to a new database or change a port.

config.json

Prism creates this file on the first start.

config.json
{
    "AUTHENTICATION": {
        "SECRET": "generated-on-first-start"
    },
    "DATABASE": {
        "TYPE": "POSTGRES",
        "HOST": "localhost",
        "PORT": "5432",
        "USER": "admin",
        "PASSWORD": "password",
        "DATABASE": "Prism"
    },
    "SERVER": {
        "WEB": {
            "PORT": 3000,
            "URL": null,
            "DEVELOPER": false
        },
        "API": {
            "PORT": 3001,
            "URL": null,
            "LOGS": true
        }
    }
}
KeyWhat it does
AUTHENTICATION.SECRETSigns sessions and Prism's internal requests. Generated for you. Leave it alone once Prism is running.
DATABASE.TYPEPOSTGRES, MYSQL or MARIADB.
DATABASE.HOST, PORT, USER, PASSWORDHow to reach the database.
DATABASE.DATABASEThe database name. It must already exist.
SERVER.WEB.PORTPort for the store site and dashboard.
SERVER.WEB.URLPublic site address, such as https://shop.example.com. Used for sign-in redirects and checkout return links.
SERVER.WEB.DEVELOPERServes the web app with live reload instead of a build. Only for working on Prism itself.
SERVER.API.PORTAPI port.
SERVER.API.URLPublic API address, such as https://api.shop.example.com.
SERVER.API.LOGSPrints each API request to the console.

Leave both URLs as null while running on your own computer. Set them from Settings > Server URLs when you move to a domain.

Environment Variables

These override config.json when set, which suits Docker and panels that only let you set variables. Prism also reads a .env file in its folder.

VariableOverrides
PRISM_DATABASE_TYPEDATABASE.TYPE
PRISM_DATABASE_HOSTDATABASE.HOST
PRISM_DATABASE_PORTDATABASE.PORT
PRISM_DATABASE_USERDATABASE.USER
PRISM_DATABASE_PASSWORDDATABASE.PASSWORD
PRISM_DATABASE_NAMEDATABASE.DATABASE
PRISM_WEB_PORTSERVER.WEB.PORT
PRISM_WEB_URLSERVER.WEB.URL
PRISM_API_PORTSERVER.API.PORT
PRISM_API_URLSERVER.API.URL
API_LOGSSet to false to turn off API request logs.

Settings Page

Settings has three tabs.

General

SectionWhat it holds
LanguageDisplay language, secondary language and whether visitors see a language dropdown.
ConsoleDebug output, API request logs, 12-hour clock and seconds in timestamps.
BrandingSite name and a custom icon.
Server URLsPublic web and API addresses and ports. Changing them asks for a restart.
SMTPThe mail server for verification, password reset and email change messages. Send Test Email checks it.
S3 StorageThe bucket for product downloads: Cloudflare R2, Amazon S3 or any S3-compatible service. Test Connection checks it.
UpdatesYour version, update checks and automatic updates on restart.

OAuth

SectionWhat it holds
Discord Sign InDiscord client ID and secret.
Sign-in ProvidersGoogle, Apple and GitHub. Leave one blank to turn it off.
Email & PasswordShow the email and password form, and send verification and reset emails. Sending needs SMTP.
Allow Email ChangesLet people change the email on their account. See Accounts.

Checkout

Payment gateways, currency, cart, addons, coupons, sales, points and the purchase webhook. See Checkout.

Secrets such as client secrets, the SMTP password, the S3 secret key and gateway keys are never sent back to the browser once saved. The field shows that a value is set, and saving without changing it keeps the stored value.

Module Settings

Each module with settings has its own page under Configs. Core has none. The Kora module adds its API and automation settings there.

Resetting

To start over, stop Prism and run:

npm run factory-reset

It asks whether to reset the database only or everything, then asks you to type the database name. It drops every table in that database and clears the settings cache. With the database only, the next start runs the setup wizard again with your database connection kept. With everything, config.json is deleted too and the wizard starts from scratch.

FlagEffect
--databaseResets the database only, without asking.
--allResets everything, without asking for the scope.
--yesResets the database only and skips the confirmation.