Jimeng Provider
The jimeng provider is a self-contained module at src/providers/jimeng/ with zero external MCP dependencies.
File Structure
src/providers/jimeng/
βββ index.ts Public API (bootstrap, auth, generation functions)
βββ api.ts jimengPost() β sidecar-first, browser fallback
βββ browser-client.ts Puppeteer-based browser client (fallback)
βββ session-cache.ts Session persistence (~/.jimeng/session.json)
βββ config.ts Constants, model maps, resolution maps
βββ schemas.ts Zod validation schemas
βββ upload.ts Image upload to ImageX CDN
βββ tools/
β βββ image.ts Image generation handlers
β βββ video.ts Video generation handlers
β βββ credits.ts Credits management
β βββ history.ts Generation status polling
β βββ assets.ts Asset listing
βββ utils/
βββ crypto.ts UUID, CRC32, MD5 sign
βββ url.ts URL building utilities
βββ video.ts Video URL extractionAuthentication Flow
POST /auth/jimeng/qrβ Express checks if sidecar is up, calls sidecar/auth/login, returns QR as base64 PNG- User scans QR with Douyin app
GET /auth/jimeng/qr/pollβ polls sidecar/auth/poll, returnsconfirmedwhen done- Sidecar saves cookies to
jimeng-sign-service/cookies.json(365-day validity) - All subsequent API calls route through sidecar automatically
API Call Flow
Last updated on