Fork of asteria-team/whimsy
A very stupid little startpage/newtab for your browser i made on a whim
This project now uses API routes for Twitch OAuth, so server runtime is required.
- Default build mode: server (works with Next.js API routes)
- Optional static export mode: set
NEXT_STATIC_EXPORT=true(Twitch OAuth routes will not work in static export)
For Cloudflare Pages, use the Next.js framework runtime mode, not pure static export, if you want Twitch integration.
If your deploy fails with Output directory "out" not found, your Pages project is still configured for legacy static export.
Use these settings:
- Build command:
npm run build:cf - Build output directory:
.vercel/output/static - Framework preset:
Next.js(recommended)
Required environment variables in Cloudflare Pages:
TWITCH_CLIENT_IDTWITCH_CLIENT_SECRETTWITCH_OAUTH_REDIRECT_URI(recommended, for examplehttps://your-domain.com/api/twitch/oauth/callback)- Optional:
TWITCH_MAX_CHANNELS,NEXT_PUBLIC_TWITCH_REFRESH_SECONDS,NEXT_PUBLIC_TWITCH_MAX_CHANNELS
To enable the Twitch widget with frontend login, add these environment variables:
TWITCH_CLIENT_ID(required)TWITCH_CLIENT_SECRET(required)TWITCH_OAUTH_REDIRECT_URI(recommended in production)TWITCH_MAX_CHANNELS(optional server default, defaults to5, capped at100)NEXT_PUBLIC_TWITCH_REFRESH_SECONDS(optional client default, defaults to90)NEXT_PUBLIC_TWITCH_MAX_CHANNELS(optional client default, defaults to5)
Then use the Connect Twitch button in the widget to authorize your account.
The widget now has a Settings toggle where you can configure:
- Refresh interval (
30sto600s) - Number of channels shown (
1to10) - Expand/collapse to show all currently live followed channels
These settings are saved in your browser (localStorage), so they are configurable without changing env variables.
Optional fallback mode (legacy, no UI login):
TWITCH_USER_IDTWITCH_ACCESS_TOKENTWITCH_REFRESH_TOKEN
- Open the Twitch Developer Console: https://dev.twitch.tv/console/apps
- Click Register Your Application (or Create App).
- Fill out:
- Name: any app name, for example
whimsy - OAuth Redirect URL:
http://localhost:3000/api/twitch/oauth/callbackfor local dev - Category: any suitable category (for example Website Integration)
- Name: any app name, for example
- Save the app.
- Copy Client ID and set it as
TWITCH_CLIENT_ID. - Click New Secret in the app details.
- Copy the generated secret immediately and set it as
TWITCH_CLIENT_SECRET.
Important:
- Add your production callback URL too if you deploy (for example
https://your-domain.com/api/twitch/oauth/callback). - Keep
TWITCH_CLIENT_SECRETserver-only and never expose it in client-side env vars.
