Platform variables
The settings Switchboard gives your website automatically.
Switchboard gives your website a number of settings, so it knows where it's running and where its data lives. You don't need to set them yourself (and you can't). Your AI knows how to use them.
#Always present
| Name | What it is |
|---|---|
PORT |
The "house number" your website must listen on. |
HOST |
Always 0.0.0.0: listen to all connections. |
NODE_ENV |
Always production: this is the real, live website. |
DATABASE_PATH |
Where your database is: /data/app.db. |
DATABASE_URL |
The same, as an address: sqlite:////data/app.db. |
PUBLIC_URL |
Your website's address, for example https://bakerysmith.com. |
ORIGIN |
The same as PUBLIC_URL (some programs use this name). |
SECRET_KEY |
A long secret key only your website knows, for example to secure login sessions. |
BACKEND_URL |
Only with a separate backend: the internal address your website uses to reach the backend. |
#When you turn on email sending
| Name | What it is |
|---|---|
EMAIL_AWS_ACCESS_KEY_ID, EMAIL_AWS_SECRET_ACCESS_KEY |
The key your website uses to send email (through Amazon SES). It only works for mail from your own domain. |
EMAIL_AWS_REGION |
Where the mail service runs, for example eu-central-1. |
DEFAULT_FROM_EMAIL |
The sender address, for example noreply@bakerysmith.com. Your website may only send from this address. |
Using file storage too? Then your website has two keys: EMAIL_AWS_… for email and AWS_… for
storage (below). They can't stand in for each other; your AI knows which one to use.
See sending email.
#When you turn on file storage
| Name | What it is |
|---|---|
S3_BUCKET |
The name of your storage space. |
AWS_REGION |
Where your storage space is. |
AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY |
The key that lets your website use the storage. |
S3_PUBLIC_URL |
The web address of your public files (only when public files are on). It already ends in public/: just add the rest of the file name. File public/photos/shop.jpg → ${S3_PUBLIC_URL}photos/shop.jpg. |
See file uploads.
#Reserved names
You can't use these names in settings and secrets:
- all names above, like
PORT,DATABASE_URLandSECRET_KEY; - anything starting with
SB_,EMAIL_,AWS_,S3_orSWITCHBOARD_.
#While building
While your website is being built, your own settings are available too, plus NODE_ENV,
PUBLIC_URL and ORIGIN. Settings starting with PUBLIC_ (SvelteKit) or NEXT_PUBLIC_ (Next.js)
are built into your website itself and are therefore visible to everyone. Never put secrets in them.