Skip to content
Projects

SkyBlue997/MicrosoftRewardsPilot

View on GitHub

About

Self-hosted MicrosoftRewards engine, lightweight | 微软奖励自动答题搜索,多账号托管 | 自己ホスト型MicrosoftRewardsエンジン、軽量

Systems & Infrastructure

How these counts are measured

Measured star growth

in 24h
0
in 7 days
0
in 15 days
Collecting history
in 1 month
Collecting history

Net star changes over overlapping periods, not daily totals. Missing measurements are left blank. Stars measure attention, not software quality.

docs/README_EN.md

Original

中文 | English | 日本語


MicrosoftRewardsPilot Automation Script

Intelligent Microsoft Rewards Points Auto-Collection Tool

GitHub License Docker


Table of Contents

  1. Quick Start
  2. Main Configuration
  3. Troubleshooting & Testing
  4. Core Features
  5. Complete Configuration Example
  6. Important Warnings

Quick Start

Local Deployment (Click to expand)
# 1. Clone Repository
git clone https://github.com/SkyBlue997/MicrosoftRewardsPilot
cd MicrosoftRewardsPilot

# 2. Install dependencies and download the browser (requires Node.js 20 or newer)
npm run pre-build

# 3. Configuration
# Copy example configuration files and edit them
cp config/config.json.example config/config.json
cp config/accounts.json.example config/accounts.json

# 4. Build and Run
npm run build
npm start
Docker Deployment (Recommended) (Click to expand)
# 1. Prepare Configuration Files
# Copy example configuration files and edit them
cp config/config.json.example config/config.json
cp config/accounts.json.example config/accounts.json

# 2. Build the image and start the container (the image installs dependencies, downloads the browser and compiles by itself)
docker compose up -d --build

# 3. View Logs (Optional)
docker logs -f microsoftrewardspilot

Docker Compose Configuration Example:

services:
  microsoftrewardspilot:
    build: .
    container_name: microsoftrewardspilot
    restart: unless-stopped
    volumes:
      - ./config/accounts.json:/usr/src/microsoftrewardspilot/config/accounts.json
      - ./config/config.json:/usr/src/microsoftrewardspilot/config/config.json
      - ./sessions:/usr/src/microsoftrewardspilot/sessions  # Persist login sessions
    environment:
      - NODE_ENV=production
      - TZ=Asia/Tokyo  # Set according to geographic location
      - CRON_SCHEDULE=0 9,16,21 * * *  # Prefer odd / non-round / spread-out hours instead of 9,16, to avoid hitting the same instant every day; run_daily.sh additionally layers on 3-85 min of random jitter
      - RUN_ON_START=false  # Keep false: otherwise every container start (Docker/host restart) runs the bot immediately, and restarts come in bursts — several sign-ins within minutes
      # Anti-detection: enable rebrowser's Runtime.enable fix (src/rebrowser-env.ts already ships defaults; declared explicitly here for easy override)
      - REBROWSER_PATCHES_RUNTIME_FIX_MODE=addBinding
      - REBROWSER_PATCHES_UTILITY_WORLD_NAME=util
  • The browser's timezone is always detected from the exit IP; TZ only decides which timezone the container's schedule runs in.
  • Optional environment variable REWARDS_APP_VERSION: the Bing app version stated when calling the Rewards API (defaults to a real release written in the code). The app ships about weekly, so set a newer version from time to time.

Main Configuration

Basic Settings

{
  "headless": true,           // Run in headless mode
  "parallel": false,          // Run desktop and mobile in parallel
  "clusters": 1,              // Number of clusters
  "globalTimeout": "180min",  // Time budget for one account's run
  "accountDelay": {           // Delay between accounts
    "min": "8min",            // Minimum delay 8 minutes
    "max": "20min"            // Maximum delay 20 minutes
  }
}

Smart Search Configuration

Search spacing (log-normal delay) and human-like typing are built in; query language auto-localizes per account market (full query banks for ja/en/zh-CN/vi). Tunable keys:

{
  "searchSettings": {
    "multiLanguage": {
      "enabled": true,              // Multi-language support
      "autoDetectLocation": true    // Auto-detect location (drives query & timezone localization)
    },
    "autoTimezone": {
      "enabled": true,              // Auto timezone
      "setOnStartup": true          // Set on startup
    }
  }
}

Task Configuration

Other claimable activities (daily set, check-ins, read-to-earn, puzzles) are auto-claimed and need no toggle.

{
  "workers": {
    "doDesktopSearch": true,   // Desktop search
    "doMobileSearch": true,    // Mobile search (Level 2+)
    "doMorePromotions": true   // Explore on Bing / promotional tasks
  }
}

Popup Handling Configuration

{
  "popupHandling": {
    "enabled": false,                    // Enable popup handling (disabled by default)
    "handleReferralPopups": true,        // Handle referral popups
    "handleStreakProtectionPopups": true,// Handle streak protection popups
    "handleStreakRestorePopups": true,   // Handle streak restore popups
    "handleGenericModals": true,         // Handle generic modals
    "logPopupHandling": true             // Log popup handling
  }
}

Passkey Handling Configuration

{
  "passkeyHandling": {
    "enabled": true,              // Enable Passkey handling
    "maxAttempts": 5              // Maximum attempts
  }
}

Troubleshooting & Testing

Sign-in Needs 2FA / Manual Verification

Problem: Scheduled runs get stuck at 2FA, a passkey prompt, "Stay signed in?" or a consent page (logs show Bing login verification failed, OAuth authorization timeout, etc.)

Solution: Run the interactive sign-in tool and complete the verification once in a visible browser

npm run login                          # desktop + mobile sessions
npm run login -- --mobile              # mobile session only (or --desktop)
npm run login -- --email [email protected]   # pick an account when there are several

How it works:

  1. Reads the account (including its proxy) from config/accounts.json and opens a visible window with the same fingerprint/geo settings the scheduled runs use
  2. Fills in email and password automatically; SMS/email codes are asked for in the terminal
  3. Anything the automation can't get past (2FA, passkey, consent, ...) you finish in the window; once it leaves Microsoft's sign-in pages the tool re-checks automatically (or press Enter in the terminal to check right away)
  4. Mints the OAuth token and reads the points balance; the session is saved to sessions/<email>/ only after that succeeds
  5. Later scheduled runs reuse the session. For Docker, run it on the host (./sessions is mounted into the container) — no image rebuild needed

Popup Handling Issue

Problem: Program gets stuck in popup handling, infinite loop occurs

Symptoms: Log shows repeated popup detection info

[REWARDS-POPUP] 🎯 Detected Streak Protection Popup
[REWARDS-POPUP] 🎯 Detected Streak Protection Popup

Solution:

  1. Immediate fix: Disable popup handling in config/config.json
{
  "popupHandling": {
    "enabled": false
  }
}
  1. Selective enable: Only enable required popup types
{
  "popupHandling": {
    "enabled": true,
    "handleReferralPopups": true,
    "handleStreakProtectionPopups": false,
    "handleStreakRestorePopups": false
  }
}

Passkey Setup Loop Issue

Problem: After login, redirected to Passkey setup page, clicking "Skip for now" causes infinite loop

Symptoms: Program stuck after "Starting login process!"

Solution: System automatically handles Passkey loop issue

  • Auto detection: Detect Passkey setup page
  • Multiple bypasses: Skip button, ESC key, direct navigation
  • Smart retry: Up to 5 attempts to prevent infinite loop
  • Configurable: Adjust handling strategy via config

Config options:

{
  "passkeyHandling": {
    "enabled": true,
    "maxAttempts": 5
  }
}

Common Issues

Points Collection Limited/Automation Detected

Symptoms: Several searches in a row earn no points, or point collection looks incomplete Explanation: Most of the time this is NOT detection, but rather:

  • Reward-day reset boundary (around local midnight): dapi returns an inconsistent snapshot (search/read counters flicker between "already reset" and "old value"). Don't run during this window — run at stable hours (e.g. the morning/evening cron of the script).
  • Today's activities already done: a second run on the same day is usually +0 (the correct, idempotent behavior).
  • If you really are throttled: reduce run frequency and avoid many quick logins in a short span; the built-in anti-detection (rebrowser patch, fingerprint consistency, log-normal delays) recovers with normal use.
Geo-location Detection Failure

Solution: Check network connection, ensure access to geo-location API services

Timezone Mismatch

Solution: The browser's timezone is detected from the exit IP and needs no setting; the TZ environment variable only affects when the container's scheduled runs fire, so make sure it is the timezone you want

Out of Memory

Solution: Restart container or check system resource usage

Docker Troubleshooting

# View logs
docker logs microsoftrewardspilot

# Test network connection
docker exec microsoftrewardspilot ping google.com

# Check geo-location (same service used by the code in GeoLanguage.ts)
docker exec microsoftrewardspilot curl -s https://ipapi.co/json

Core Features

Supported Tasks

The new rewards.bing.com is now a Next.js SPA with no scrapable DOM; this project instead talks to the dapi backend API (activities claimed directly) plus real search / visual search.

  • Daily Task Set / Daily Activities / Promotional Tasks - "click-to-complete" activities auto-claimed via the dapi API (urlreward / read-to-earn / check-in, including daily-quote-style urlreward cards); interactive quizzes that require answering are NOT auto-completed
  • Desktop Search - Real, human-paced Bing searches; progress read from dapi
  • Mobile Search - Mobile device simulation (Level 2+, shares the daily search cap with PC)
  • Explore on Bing - Activated by clicking the offer's card in Bing's Rewards panel, then completed by searching the topic the card names
  • Visual Search - Auto-completes the Bing visual-search activity
  • Daily Check-in - Web check-in + Bing-app check-in (two independent check-ins)
  • Read to Earn - Earn points by reading articles

Smart Features

  • Multi-Account Support - Parallel cluster processing
  • Session Storage - No repeated login, 2FA support
  • dapi Backend Integration - The new SPA has no scrapable DOM, so the bot uses the Rewards backend API (prod.rewardsplatform.microsoft.com/dapi); rewards.bing.com is only the login/landing host
  • Geo-location Detection - Region and timezone detected from the exit IP
  • Timezone Synchronization - The browser's timezone always matches the IP's location
  • Localization - Localizes queries per account market and sends the matching X-Rewards-Language
  • rebrowser Anti-Detection - Enables the patch that removes Playwright's Runtime.enable CDP leak
  • Fingerprint Consistency - fingerprint-injector injection; UA, Client Hints (in the page and in request headers), window/screen size and scale all agree with each other
  • Honest Version - The Edge version in the UA never exceeds the real browser engine's; to move the UA forward, upgrade rebrowser-playwright
  • App API Identity - Calls the Rewards API with the Bing app's request headers
  • Terms Update Page - Microsoft's "We're updating our terms" page is acknowledged automatically during sign-in, so unattended runs don't stall on it
  • Human-like Behavior - Per-character typing, variable-direction scrolling, result clicks and dwell
  • Human-like Delays - Log-normal-distributed search spacing (no hard interval boundaries)
  • Cadence Randomization - Account-order shuffle, run-start jitter
  • Popup Smart Handling - Auto-detect and close various Microsoft Rewards popups
  • Passkey Loop Bypass - Auto-handle Passkey setup loop issues
  • Docker Support - Containerized deployment
  • Detailed Logging - Complete execution records
  • Flexible Configuration - Rich customization options
  • Chinese Localization - China accounts search from a built-in zh-CN query bank (one of the fully-localized languages ja/en/zh-CN/vi)

Complete Configuration Example

See the repo's config/config.json.example for the full template (Quick Start already had you cp it). Below lists only the keys that actually take effect:

Effective config keys (Click to expand)
{
  "baseURL": "https://rewards.bing.com",
  "sessionPath": "sessions",
  "headless": true,
  "parallel": false,
  "clusters": 1,
  "saveFingerprint": {
    "mobile": true,
    "desktop": true
  },
  "workers": {
    "doDesktopSearch": true,
    "doMobileSearch": true,
    "doMorePromotions": true
  },
  "globalTimeout": "180min",
  "accountDelay": {
    "min": "8min",
    "max": "20min"
  },
  "searchSettings": {
    "multiLanguage": {
      "enabled": true,
      "autoDetectLocation": true
    },
    "autoTimezone": {
      "enabled": true,
      "setOnStartup": true,
      "validateMatch": true,
      "logChanges": true
    }
  },
  "logExcludeFunc": [
    "SEARCH-CLOSE-TABS"
  ],
  "webhookLogExcludeFunc": [
    "SEARCH-CLOSE-TABS"
  ],
  "webhook": {
    "enabled": false,
    "url": ""
  },
  "popupHandling": {
    "enabled": false,
    "handleReferralPopups": true,
    "handleStreakProtectionPopups": true,
    "handleStreakRestorePopups": true,
    "handleGenericModals": true,
    "logPopupHandling": true
  },
  "passkeyHandling": {
    "enabled": true,
    "maxAttempts": 5
  }
}

Important Warnings

Risk Warning Using automation scripts may result in account suspension

Safety Recommendations Use moderately, system has automatically enabled all anti-detection features

Regular Updates Keep the script updated to the latest version


Enjoy using the script!

Star History Chart

If this project helps you, please consider giving it a Star!

Explore related projects

Loading…