Description
In app/customize/utils.ts, the badge base URL is hardcoded to the production Vercel deployment:
const BADGE_BASE_URL = 'https://commitpulse.vercel.app/api/streak';
This means the customize page always generates badge URLs pointing to production, even when running locally or on a staging/preview deployment. Developers testing locally will generate badges that hit the production API instead of their local server, making it impossible to test badge customization against a local build.
Steps to Reproduce
- Run the app locally
- Navigate to the customize page
- Configure a badge with custom colors or theme
- Copy the generated badge URL or embed snippet
- Observe the URL points to https://commitpulse.vercel.app/api/streak instead of http://localhost:3000/api/streak
Expected Behavior
BADGE_BASE_URL should use the NEXT_PUBLIC_SITE_URL environment variable with a fallback to the production URL, consistent with how BASE_URL is defined in app/(root)/dashboard/[username]/page.tsx:
const BADGE_BASE_URL = ${process.env.NEXT_PUBLIC_SITE_URL ?? 'https://commitpulse.vercel.app'}/api/streak;
Screenshots / Logs
N/A
GitHub Username (If applicable)
N/A
Environment
Chrome
Description
In
app/customize/utils.ts, the badge base URL is hardcoded to the production Vercel deployment:const BADGE_BASE_URL = 'https://commitpulse.vercel.app/api/streak';
This means the customize page always generates badge URLs pointing to production, even when running locally or on a staging/preview deployment. Developers testing locally will generate badges that hit the production API instead of their local server, making it impossible to test badge customization against a local build.
Steps to Reproduce
Expected Behavior
BADGE_BASE_URL should use the NEXT_PUBLIC_SITE_URL environment variable with a fallback to the production URL, consistent with how BASE_URL is defined in app/(root)/dashboard/[username]/page.tsx:
const BADGE_BASE_URL =
${process.env.NEXT_PUBLIC_SITE_URL ?? 'https://commitpulse.vercel.app'}/api/streak;Screenshots / Logs
N/A
GitHub Username (If applicable)
N/A
Environment
Chrome