App options
The keys of the app itself, at the top level of protobase.config.ts.
- Type:
string - Default:
Protobase - Environment variable:
PROTOBASE_APP_NAME, which overrides it
The app’s name: sign-in prompts and passkeys show it, the mail it sends names the app with it and is sent as it, and the sidebar, the browser tabs and the installed app are called by it. A deployment renames the app with PROTOBASE_APP_NAME, which wins over the config. The name reaches the app through its sign-in, so with sign-in off (auth: false, or an authenticate.jwksUrl without auth) the app shows PROTOBASE_APP_NAME, else Protobase, and only protobase mobile reads name itself. See App identity.
export default defineConfig({ name: 'Property Finder' })- Type:
string - Default:
PROTOBASE_URL; inprotobase dev, the dev server’s own address, which the local commands that build sign-in, such asusers createandauth migration, use too - Environment variable:
PROTOBASE_URL
The app’s public URL: the issuer and audience of its tokens, and where its emails link to. Sign-in and unsubscribe need it. With auth on, protobase serve stops with a clear message when it is missing. The local commands that build sign-in, such as users create, auth migration and migration, use the address protobase dev serves the project on, http://localhost: and the port it keeps in .protobase/dev-port, and keep a free port there first when dev has kept none, so a later protobase dev serves on the address they used. With unsubscribe: true, protobase serve stops when it is missing too, auth on or off, and when it is not https://, but for localhost and 127.0.0.1. Other origins the app is served on are auth.origins.
export default defineConfig({ url: 'https://admin.example.com' })secret
Section titled “secret”- Type:
string - Default:
PROTOBASE_SECRET - Environment variable:
PROTOBASE_SECRET
The app’s secret, made with openssl rand -base64 32: it signs session cookies, upload tickets, download links, public forms’ bot checks and unsubscribe links, and encrypts the token signing keys. Sign-in and unsubscribe need it, and file fields too unless files.secret names another; public forms sign their bot checks with PROTOBASE_FORMS_SECRET instead when it is set. Keep it out of the config’s source and read it from the environment, which the default does.
export default defineConfig(({ env }) => ({ secret: env.ADMIN_SECRET }))previousSecrets
Section titled “previousSecrets”- Type:
string[] - Default:
PROTOBASE_PREVIOUS_SECRETS, comma separated; none - Environment variable:
PROTOBASE_PREVIOUS_SECRETS
The app’s secrets before secret, newest first. The app encrypts with secret and still decrypts what these encrypted, so after the secret changes the token signing keys keep signing and the tokens in flight keep verifying. Keep an old secret listed until the keys it encrypted have rotated out (signingKeyDays), and while authenticator apps set up before the change are in use. See Changing the secret.
export default defineConfig(({ env }) => ({ secret: env.ADMIN_SECRET, previousSecrets: [env.OLD_ADMIN_SECRET] }))locale
Section titled “locale”- Type:
'en' | 'nl' - Default: each user’s browser’s language, when the screens come in it; English otherwise
The language of the admin app’s built-in screens and of its numbers and dates, for every user. Any other value stops the app at start. See Languages.
export default defineConfig({ locale: 'nl' })timezone
Section titled “timezone”- Type:
string - Default:
UTC
The time zone the jobs’ schedules are read in, such as Europe/Amsterdam, unless a job names its own timezone. See Recurring jobs.
export default defineConfig({ timezone: 'Europe/Amsterdam' })themeColor
Section titled “themeColor”- Type:
string, any CSS colour
The colour of the installed app’s title bar and of the browser’s toolbar around it, the web manifest’s theme_color. See App identity.
export default defineConfig({ themeColor: '#0d9488' })backgroundColor
Section titled “backgroundColor”- Type:
string, any CSS colour
The colour of the screen the installed app shows while it starts, the web manifest’s background_color, and the background of the mobile app’s own icon.
export default defineConfig({ backgroundColor: '#ffffff' })mobile
Section titled “mobile”- Type:
{ appId: string; plugins?: Record<string, string>; publicKey?: string; icon?: string; splash?: { image?: string; background?: string; dark?: { image?: string; background?: string } } }
The app’s iOS and Android build: with it, protobase mobile builds the app with Capacitor, and the API also allows the app’s Capacitor origins (capacitor://localhost, https://localhost) for CORS. See A mobile app.
appId: the app’s id on both iOS and Android, such ascom.example.shop: two or more dot-separated parts, each a letter then letters and digits.plugins: extra native Capacitor plugins, by npm name and version range. A range fetched over plainhttp:orgit:is refused.publicKey: the public key, PEM, of the RSA key the server signs the app’s releases with, fromprotobase mobile keys: with it the Android and iOS app update themselves. Anything but an RSA public key of at least 2048 bits stops the build.icon: the app’s home-screen icon, a path from the project’s folder to a square PNG of at least 1024 × 1024 pixels or a square SVG, from whichprotobase mobilemakes every iOS and Android icon. Without it the app shows Protobase’s icon.splash: the app’s own splash screen, animagecentred on abackgroundcolour, withdarkvalues for dark mode, each optional. Without it the app opens on its icon over its theme background.
export default defineConfig({ mobile: { appId: 'com.example.shop', plugins: { '@capacitor/camera': '^8.0.0' } },})resources
Section titled “resources”- Type:
'none'
Says the app has no resources on purpose, such as an app that only signs people in for other apps. protobase doctor refuses an app whose config/index.ts exports no resource, since one that lost them by mistake would deploy with nothing to serve; with resources: 'none' it accepts one with none, and refuses one that exports a resource. Without the key, doctor keeps refusing an app with none.
An app with no resources builds and serves as any other: sign-in, the account page, its API functions and plugins’ routes. Its sidebar has no resource entries, and / opens the signed-in person’s account page when there is no page or resource to open.
export default defineConfig({ resources: 'none' })