A rebuild of the classic Trakt site for today's big screens, running entirely on the public Trakt API. It's live at og.trakt.tv.
OG Redux is a SvelteKit app forked from trakt-web, Trakt's v3 web app. The app lives in projects/client/.
Contributions are welcome. See AGENTS.md for the contribution rules and .agents/rules/ for the design, accessibility and testing rules.
OG Redux signs in with Trakt in the browser (OAuth with PKCE), so it only needs a client ID. There's no client secret.
- Go to the Trakt developer portal and create a new app.
- Under its redirect URIs, add one per line:
http://localhost:5173/callbackhttp://localhost:5174/callback(a second checkout or worktree on the next port)
- Under its JavaScript (CORS) origins, add one per line:
http://localhost:5173http://localhost:5174
- Save it and copy its Client ID.
A new app is a Standard app. The setup below is ready for one, and doesn't need Developer Premium. See Standard and Premium apps for the parts of the site it can't load.
-
Clone the repository
git clone https://github.com/trakt/trakt-og.git cd trakt-og -
Install dependencies from the lockfile
bun run install:frozen
-
Set up your local settings with your app's Client ID. This works the same in every shell, Windows included:
bun run client:setup <your client id>
It creates
projects/client/.env.developmentfrom.env.example, which points og atapi.trakt.tvfor a Standard app (PUBLIC_TRAKT_API=standard), and adds your client ID. Run it again to change the ID. It also copies.dev.vars.exampleto.dev.vars, which opens every page locally and leaves the optional keys empty. With a Premium app, you can setPUBLIC_TRAKT_API=productionin.env.developmentto useapiz.trakt.tv. -
Start the dev server
bun run client:dev
Open http://localhost:5173 and sign in from the header. Add
--port 5174to run a second copy.
| Variable | Where | Needed | What it does |
|---|---|---|---|
TRAKT_CLIENT_ID |
projects/client/.env.development |
Yes | Your Trakt app's client ID. It's inlined into the bundle at build time, like trakt-web. A shell export overrides the file. |
TRAKT_CLIENT_ID |
projects/client/.env.production |
For local production builds | The og.trakt.tv app's ID, used by client:build and the manual client:deploy. |
PUBLIC_TRAKT_API |
Shell or .env.development |
Set by the example | standard, the example's, talks to https://api.trakt.tv, for Standard apps. production, the default when unset and og.trakt.tv's, talks to https://apiz.trakt.tv, for Premium apps. local talks to a local API at http://localhost:8787. |
KLIPY_API_KEY |
projects/client/.dev.vars |
No | Turns on the GIF picker in comment composers. |
GITHUB_TOKEN |
projects/client/.dev.vars |
No | A read-only GitHub token for the about page's GitHub reads, for the higher rate limit. |
.env.development, .env.production and .dev.vars are gitignored. .dev.vars is only read locally; deploys read Worker secrets instead.
The Trakt API serves Standard apps on https://api.trakt.tv and Premium apps on https://apiz.trakt.tv. .env.example sets PUBLIC_TRAKT_API=standard for a Standard app. In dev, og logs a hint when apiz refuses your client ID.
Some routes are only open to Trakt's own apps, so neither a Standard nor a Premium app can load them. og hides what's built on them and says so once in the browser console. The rest of the page works:
- Where to Watch, under the poster, and the Watch now buttons that open it.
- Streaming service filters, and the streaming services in Tune your picks.
- The dashboard's Social Feed.
- List collaborators, in the list editor.
Private Notes, watchlist buttons, "on a list" badges and the list picker for seasons and episodes fall back to reads every app may make.
Standard apps also get lower rate limits. When the API rate limits you, the page or section says so and offers Try again, and you stay signed in.
Run these from the repository root.
| Command | What it does |
|---|---|
bun run client:setup <id> |
Writes the local settings for your Trakt app's client ID. |
bun run client:dev |
Starts the dev server on port 5173. |
bun run client:check |
Type checks. |
bun run client:test |
Runs the tests. |
bun run client:build |
Builds for production. |
bun run client:ci |
Formatting, lint, types, tests and the production build: everything CI runs. |
bun run client:verify [pr] |
CI plus the supply chain, commit and leak checks. |
bun run client:land <pr> |
Rebases, verifies and lands a PR, then closes its issues. |
bun run client:seo-check [url] |
Checks what crawlers and link previews see, against the dev server or a URL. |
To try the production build locally, run bun run preview in projects/client/. It builds, then serves the Cloudflare Worker with wrangler dev.
Every merge to main deploys og.trakt.tv through GitHub Actions, built with the TRAKT_CLIENT_ID repo secret. PRs land through bun run client:land <pr>, never straight to main. bun run client:deploy is a manual redeploy of main for maintainers.