Environment Variables
For StudioCMS to work correctly, you must set up the correct environment variables. These variables are essential for establishing a secure connection to Astro DB and authenticating with the StudioCMS API. Without correctly configuring these environment variables, the application will not function as intended.
You can create a .env
file in the root directory of your project and add the required environment variables. The .env
file is a text file that contains key-value pairs of environment variables. The environment variables are read by the application at runtime.
For future reference on how to work with environment variables within Astro you can checkout Environment Variables^ from the Astro documentation.
Required Environment Variables
Section titled “Required Environment Variables”In order to use StudioCMS, there are a few required environment variables that you must set up in your .env
file.
Database URL and Token for @astrojs/db
Section titled “Database URL and Token for @astrojs/db”ASTRO_DB_REMOTE_URL
- The connection URL to your libSQL serverASTRO_DB_APP_TOKEN
- The app token for your libSQL server
ASTRO_DB_REMOTE_URL=libsql://your.server.ioASTRO_DB_APP_TOKEN=eyJh...RUCg
@astrojs/db
see, the Astro docs for Astro DB^ Encryption Key for @studiocms/auth
Section titled “Encryption Key for @studiocms/auth”CMS_ENCRYPTION_KEY
- A secure encryption key for encrypting sensitive data
CMS_ENCRYPTION_KEY="wqR+w...sRcg=="