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
If using Astro’s Studio
with @astrojs/db
Astro Studio Account Required ASTRO_STUDIO_APP_TOKEN
- Token provided from the Astro Studio Dashboard
If using libSQL
with @astrojs/db
ASTRO_DB_REMOTE_URL
- The connection URL to your libSQL server
ASTRO_DB_APP_TOKEN
- The app token for your libSQL server
Authentication Environment Variables
Currently there are 5 ways to authenticate with StudioCMS:
GitHub
To authenticate with GitHub, you need to add the following environment variables to your .env
file:
Discord
Auth0
Username and Password
Alternatively, you can authenticate with StudioCMS using your username and password which doesn’t require any additional environment variables.
Image Handler Environment Variables
Cloudinary (Optional)
If you choose to use the built-in Cloudinary plugin, you will need to define the following: