TypeType-Token generates YouTube PO tokens for TypeType-Server. The frontend never calls this service directly.
It runs as a small Bun service inside the TypeType stack and is consumed over HTTP by the backend.
A dedicated token microservice for the YouTube BotGuard and Proof-of-Origin flow.
It fetches visitor data, solves BotGuard challenges, generates integrity tokens, caches results, and returns PO token data to TypeType-Server.
- Not a public API for browsers.
- Not a frontend dependency.
- Not an extraction service.
- Not a general YouTube client.
| Role | Tool |
|---|---|
| Runtime | Bun |
| HTTP server | Bun.serve() |
| BotGuard challenge | bgutils-js |
| Browser runtime | Playwright Chromium |
| Cache | Bun Redis client with Dragonfly |
| Tests | bun:test |
| Lint and format | Biome |
| Method | Path | Description |
|---|---|---|
GET |
/potoken?videoId=<id> |
Returns PO token data for one YouTube video ID |
Response shape:
{
"poToken": "...",
"visitorData": "...",
"streamingPot": "..."
}Errors return HTTP 500 with:
{ "error": "descriptive message" }Run from source:
bun run src/index.tsBuild and run the production bundle:
bun build src/index.ts --outfile dist/index.js --target bun
bun dist/index.jsThe service listens on port 8081.
bun install
bun test
bun run lintContainer tags are published to GHCR with:
| Tag | Source |
|---|---|
latest |
Default branch builds |
sha-<short-sha> |
Every build |
main |
Main branch |
v* |
Git release tags |
- TypeType is the deployment stack.
- TypeType-Server calls this service for token data.
- TypeType web never calls this service directly.
- deniscerri/ytdlnis for the BotGuard and PO token reference flow.
- LuanRT/BgUtils for
bgutils-js. - yt-dlp for Innertube compatibility references.
MIT. See LICENSE.