Replaces Vercel Analytics with OpenPanel, driven entirely by env vars so the whole layer is inert until NEXT_PUBLIC_OPENPANEL_CLIENT_ID is set. Zero initial load cost. next/script emits a rel=preload even on lazyOnload, which pulls the sdk during the first paint, so the component skips it: it inlines the 416 byte official stub (window.op queues calls immediately) and appends the real script itself on window load plus requestIdleCallback. The built html carries no preload and no script src for the analytics host. Events live in one typed catalogue (lib/analytics/events.ts) and track() is keyed to it, so a wrong name or payload is a type error rather than a silent bad row. Emitters sit in the hooks that already own the behaviour instead of being sprinkled through components: - useShowState covers every favourite and watchlist toggle - useInfiniteList covers pagination for all six lists - useTorrents covers all three providers - Preview, Person and useSearch use a shared useTrackOnce hook Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
21 lines
1.1 KiB
Plaintext
21 lines
1.1 KiB
Plaintext
MOVIE_DB_TOKEN=YOUR_TOKEN
|
|
PIRATE_BAY_HOST=https://thepiratebay10.org
|
|
YTS_HOST=https://yts.mx/api/v2/list_movies.json
|
|
TOLOKA_HOST=https://toloka.to
|
|
TOLOKA_USERNAME=your_toloka_username
|
|
TOLOKA_PASSWORD=your_toloka_password
|
|
NEXT_PUBLIC_TORRENT_PROXY=http://localhost:8090
|
|
# Optional: external subtitles in the web player — free API key at https://www.opensubtitles.com/en/consumers
|
|
OPENSUBTITLES_API_KEY=your_api_key
|
|
# Optional: logging in raises the download quota (anonymous keys get ~5 downloads/day)
|
|
OPENSUBTITLES_USERNAME=your_opensubtitles_username
|
|
OPENSUBTITLES_PASSWORD=your_opensubtitles_password
|
|
# Comma-separated preferred subtitle languages (ISO 639-1)
|
|
SUBTITLE_LANGUAGES=en,uk
|
|
# Optional: self-hosted OpenPanel analytics. Unset means analytics is a no-op and no script loads.
|
|
NEXT_PUBLIC_OPENPANEL_CLIENT_ID=your_openpanel_client_id
|
|
NEXT_PUBLIC_OPENPANEL_API_URL=https://analytics.example.org/api
|
|
NEXT_PUBLIC_OPENPANEL_SCRIPT_URL=https://analytics.example.org/op1.js
|
|
# Optional: persists the Toloka session across serverless cold starts (falls back to in-memory)
|
|
UPSTASH_REDIS_REST_URL=https://your-db.upstash.io
|
|
UPSTASH_REDIS_REST_TOKEN=your_upstash_token |