How chiihero/microsoft-rewards-script works
This is a TypeScript/Patchright automation bot for Microsoft Rewards, with an optional HTTP control API. Its main workflow loads account and behavior configuration, creates or reuses browser sessions, signs in, then runs search and Rewards activities and reports outcomes. Search topics can come from configurable providers; optional tasks include visual search, Read-to-Earn, and experimental API search. The README also documents a separate API and dashboard workflow for runtime control. Several activity and API implementations were not sampled, so those documented subsystems are shown without speculative internal call chains.
Main entry points: index.ts Bot orchestration · server.js Control API · SearchManager.ts Search orchestration · Login.ts Account login
Components 31
Bot runtime
- Bot orchestration
src/index.ts - Configuration
src/util/Load.ts - Account validation
src/util/Validator.ts - HTTP client
src/util/Http.ts
Browser and identity
- Browser lifecycle
src/browser/Browser.ts - Browser operations
src/browser/BrowserFunc.ts - Account login
src/browser/auth/Login.ts - Login methods
src/browser/auth/methods - Session store
src/util/SessionStore.ts
Rewards tasks
- Search orchestration
src/functions/activities/search/SearchManager.ts - Search progress
src/functions/activities/search/SearchProgress.ts - Browser search
src/functions/activities/search/BrowserSearch.ts - Query engine
src/functions/QueryEngine.ts - Query queue
src/functions/SearchQueryQueue.ts - Activity runner
src/functions/Activities.ts - Rewards activities
src/functions/activities - Visual search
src/functions/activities/visualSearch/VisualSearch.ts
Control API
- Control API
scripts/api/server.js - Process manager
scripts/api/processManager.js - Account controls
scripts/api/accounts.js - Config editor
scripts/api/configEditor.js - Schedule management
scripts/api/scheduleStore.js - Log parsing
scripts/api/logParser.js
Logging and notices
- Logger
src/logging/Logger.ts - Notification channels
src/logging - ClawBot client
src/util/ClawBotClient.ts
Other components
- Operator
- Dashboard client
- Microsoft Rewards
- Query sources
- WeChat iLink
Connections 31
- Operator → Bot orchestration: starts run
README.md - Bot orchestration → Configuration: loads config
src/index.ts - Bot orchestration → Account validation: validates accounts
src/index.ts - Bot orchestration → Browser lifecycle: manages browser
src/index.ts - Bot orchestration → Account login: runs login
src/index.ts - Account login → Login methods: uses methods
src/browser/auth/Login.ts - Account login → Session store: saves session
src/browser/auth/Login.ts - Browser lifecycle → Session store: restores session
- Account login → Microsoft Rewards: authenticates
README.md - Bot orchestration → Search orchestration: runs searches
src/index.ts - Search orchestration → Search progress: reads quotas
src/functions/activities/search/SearchManager.ts - Search orchestration → Browser search: dispatches search
README.md - Bot orchestration → Activity runner: runs activities
README.md - Activity runner → Rewards activities: dispatches tasks
README.md - Activity runner → Visual search: dispatches optional
README.md - Search orchestration → Query queue: requests topics
README.md - Query queue → Query engine: gets queries
src/functions/SearchQueryQueue.ts - Query engine → Query sources: fetches topics
src/functions/QueryEngine.ts - Search orchestration → Microsoft Rewards: earns search points
README.md - Dashboard client → Control API: controls bot
README.md - Control API → Process manager: controls processes
scripts/api/server.js - Control API → Account controls: routes account actions
scripts/api/server.js - Control API → Config editor: routes config edits
scripts/api/server.js - Control API → Schedule management: routes schedules
scripts/api/server.js - Control API → Log parsing: routes log queries
scripts/api/server.js - Bot orchestration → Logger: records run
src/index.ts - Logger → Notification channels: dispatches notices
src/logging/Logger.ts - Notification channels → ClawBot client: sends ClawBot
src/logging/ClawBot.ts - ClawBot client → WeChat iLink: sends messages
src/util/ClawBotClient.ts - Query engine → HTTP client: requests sources
src/functions/QueryEngine.ts - HTTP client → Microsoft Rewards: makes web requests
README.md