Overview
Your portfolio requires API access to:- Spotify: Display artist profile, tracks, and playlists
- SoundCloud: Fetch latest productions and user metrics
- YouTube: Show video playlists and latest sessions
- Google Calendar: Sync upcoming gigs and events
All API credentials should be stored as environment variables and never committed to version control.
Spotify API Setup
Create a Spotify App
- Go to the Spotify Developer Dashboard
- Log in with your Spotify account
- Click Create an App
- Fill in the app name (e.g., “Jowy Portfolio”) and description
- Accept the Terms of Service and click Create
Get Your Credentials
Once your app is created, you’ll see the app dashboard:
- Click Settings in the top right
- Copy your Client ID
- Click View client secret and copy your Client Secret
Get Your Artist ID
- Go to your Spotify artist profile
- Click the Share button (three dots menu)
- Select Copy link to artist
- Your Artist ID is the string after
/artist/in the URL
https://open.spotify.com/artist/ABC123XYZ → Artist ID is ABC123XYZHow Spotify Authentication Works
The portfolio uses the Client Credentials Flow to authenticate with Spotify. The authentication process:- Encodes your Client ID and Secret in Base64
- Requests an access token from
https://accounts.spotify.com/api/token - Caches the token server-side (expires in ~3600 seconds)
- Automatically refreshes the token when it expires
src/server/services/spotify/auth.ts:15-49.
SoundCloud API Setup
Create a SoundCloud App
- Go to SoundCloud for Developers
- Sign in with your SoundCloud account
- Navigate to Your Apps and click Register a new app
- Fill in the required information:
- App name
- Description
- Redirect URI (use
http://localhost:4321for development)
- Accept the Terms of Use and click Register
Get Your Credentials
After creating your app:
- Copy your Client ID
- Copy your Client Secret
- Generate an Authorization token (usually in the format
OAuth <token>)
Get Your User ID
To fetch your tracks and profile:
- Go to your SoundCloud profile
- Your User ID is in the URL or can be found via the API
- Alternatively, use the SoundCloud API:
- The response will contain your numeric
id
SoundCloud Authentication
The portfolio uses the Client Credentials grant to authenticate:- Sends a POST request to
https://secure.soundcloud.com/oauth/token - Includes Client ID, Client Secret, and Authorization header
- Receives an access token (typically valid for 3600 seconds)
- Caches the token server-side with automatic refresh
src/server/services/soundcloud/auth.ts:21-58.
YouTube Data API Setup
Create a Google Cloud Project
- Go to the Google Cloud Console
- Create a new project or select an existing one
- Name your project (e.g., “Jowy Portfolio”)
Enable YouTube Data API v3
- In the Google Cloud Console, go to APIs & Services → Library
- Search for “YouTube Data API v3”
- Click on it and press Enable
Create API Credentials
- Go to APIs & Services → Credentials
- Click Create Credentials → API Key
- Copy your API key
- (Optional but recommended) Click Restrict Key to limit it to YouTube Data API v3 only
Get Your Playlist or Channel ID
For a Playlist:
- Go to your YouTube playlist
- The Playlist ID is in the URL after
list= - Example:
https://www.youtube.com/playlist?list=PLx0sYbCqOb8T→ ID isPLx0sYbCqOb8T
- Go to your YouTube channel
- Click on any video, then click your channel name
- The Channel ID is in the URL after
/channel/
Google Calendar API Setup
Enable Google Calendar API
- In the same Google Cloud project, go to APIs & Services → Library
- Search for “Google Calendar API”
- Click on it and press Enable
Make Your Calendar Public
- Open Google Calendar
- Find the calendar you want to display (e.g., “Gigs”)
- Click the three dots next to the calendar name → Settings and sharing
- Scroll to Access permissions and check Make available to public
- Under Integrate calendar, copy the Calendar ID (usually looks like an email address)
The calendar integration embeds public calendar data. Ensure you only make calendars public that contain information you want to share on your portfolio.
Environment Variables Summary
Your complete.env file should contain:
Testing Your Configuration
After setting up all environment variables:Check the Console
Watch for any authentication errors in the terminal. Successful API calls mean your credentials are working.