Overview
Jowy Portfolio uses environment variables to securely store API credentials and configuration values. These variables are accessed viaimport.meta.env in Astro and should be defined in a .env file at the root of your project.
Required Environment Variables
Spotify Integration
Required for displaying Spotify artist information and music content.Your Spotify application client ID. Get this from the Spotify Developer Dashboard.
Your Spotify application client secret. Keep this confidential.
The Spotify artist ID to display music content for. Find this in the Spotify artist URL.
SoundCloud Integration
Required for fetching and displaying SoundCloud tracks.Your SoundCloud application client ID.
Your SoundCloud application client secret.
SoundCloud OAuth authorization token for API authentication.
The SoundCloud user ID to fetch tracks from. This is parsed as an integer in the application.
YouTube Integration
Required for displaying YouTube playlist content.Your Google Cloud YouTube Data API v3 key. Enable the YouTube Data API v3 in your Google Cloud Console.
The YouTube playlist ID to display videos from.
Google Calendar Integration
Required for displaying DJ event calendar.The Google Calendar source ID for displaying event schedules.
Setup Instructions
- Create a
.envfile in the root of your project:
- Add your environment variables:
- Restart your development server to load the new environment variables.
Usage in Code
Environment variables are accessed throughout the application usingimport.meta.env:
Astro exposes all environment variables prefixed with
PUBLIC_ to the client-side code. Since these API credentials should remain server-side only, they are not prefixed with PUBLIC_.Obtaining API Credentials
Spotify Developer Credentials
- Visit the Spotify Developer Dashboard
- Log in with your Spotify account
- Click “Create an App”
- Fill in the app name and description
- Copy the Client ID and Client Secret
- Find your artist ID from a Spotify artist URL (e.g.,
spotify:artist:ARTIST_ID)
SoundCloud API Credentials
- Visit SoundCloud Developers
- Register your application
- Obtain your Client ID and Client Secret
- Generate an authorization token for API access
- Find your user ID from your SoundCloud profile URL
YouTube Data API Key
- Go to Google Cloud Console
- Create a new project or select an existing one
- Enable the YouTube Data API v3
- Create credentials (API Key)
- Copy the API key
- Get your playlist ID from the YouTube playlist URL
Google Calendar Source
- Open Google Calendar
- Go to calendar settings
- Find the calendar you want to embed
- Copy the Calendar ID from the integration section
Troubleshooting
Common Issues
Variables are undefined- Verify the
.envfile exists in the project root - Check that variable names don’t have typos
- Restart your development server
- Verify your credentials are correct and active
- Check that API keys haven’t expired
- Ensure proper scopes/permissions are set in the API console
- Ensure the value is a valid integer
- Remove any quotes or extra characters from the ID