All API HubAll API Hub
Home
Getting Started
Changelog
Frequently Asked Questions
  • Cloudflare Helper
  • Quick Export
  • Auto Refresh
  • Auto Check-in
  • Auto Detect
  • Redemption Assistant
  • WebDAV Sync
  • Data Management
  • New API Model Sync
  • New API Channel Mgmt
  • CLIProxyAPI Integration
  • Model Redirect
  • Sorting Priority
  • Permissions
  • 简体中文
  • English
  • 日本語
Home
Getting Started
Changelog
Frequently Asked Questions
  • Cloudflare Helper
  • Quick Export
  • Auto Refresh
  • Auto Check-in
  • Auto Detect
  • Redemption Assistant
  • WebDAV Sync
  • Data Management
  • New API Model Sync
  • New API Channel Mgmt
  • CLIProxyAPI Integration
  • Model Redirect
  • Sorting Priority
  • Permissions
  • 简体中文
  • English
  • 日本語
  • Automatic Refresh and Real-time Data

Automatic Refresh and Real-time Data

Keep account balances, usage, and model lists up-to-date without manually clicking "Refresh" every time. It offers a dual strategy of a background timer and instant refresh upon opening the pop-up.

Feature Overview

  • Background Timer: Driven by autoRefreshService, it periodically calls the account refresh interface in the browser background, supporting custom intervals from 10 seconds to several hours.
  • Refresh on Open: An optional "Auto-refresh when opening the plugin" switch, suitable for scenarios where the background timer is off but data synchronization is still desired.
  • Minimum Interval Protection: Independently set minInterval to prevent overly frequent manual refreshes from triggering site risk control.
  • Instant Refresh: Execute "Refresh Now" at any time to immediately get the latest balance/quota for all sites.

Prerequisites

  1. At least one site account has been successfully added.
  2. The browser must keep the extension running (mobile Kiwi/Firefox is also acceptable, but ensure the browser is not killed by the system).
  3. If the site has Cloudflare protection, please refer to Cloudflare Bypass Helper to complete the verification first.

Settings Entry

  1. Open the plugin → Settings.
  2. Select the "Basic Settings → Auto Refresh" tab to enter the RefreshSettings panel.

Key Configuration Items

OptionDescription
Enable Auto RefreshControls the background timer switch; when off, only manual refresh is retained.
Refresh Interval (seconds)The timer's operating cycle, corresponding to accountAutoRefresh.interval. Inputting <10 seconds will trigger a warning.
Auto Refresh when Opening PluginAutomatically executes refreshNow() once every time the browser icon is clicked to open the pop-up.
Minimum Refresh Interval (seconds)Limits users from frequently clicking the "Refresh" button; default is 60 seconds.
Restore DefaultsCalls resetAutoRefreshConfig(), restoring to 360s/60s/enabled state.

How It Works

  1. After the user saves the settings, accountAutoRefresh is written to local preferences via UserPreferencesContext.
  2. The background page receives the RuntimeActionIds.AutoRefreshUpdateSettings (wire: autoRefresh:updateSettings) message and calls autoRefreshService.setupAutoRefresh():
    • If the switch is off or the configuration is incomplete, the timer is stopped.
    • Otherwise, setInterval is created based on the interval, periodically executing accountStorage.refreshAllAccounts(false).
  3. Refresh results (success/failure) are broadcast to the frontend via the AUTO_REFRESH_UPDATE message; if the pop-up is not open, it is silently ignored.

Recommended Strategies

  • High-Frequency Check: For core accounts, it is recommended to set 300-600 seconds to ensure timely balance alerts.
  • Low-Frequency + Refresh on Open: If concerned about site rate limiting, the background timer can be turned off, retaining only "Refresh on Open".
  • Combine with Notifications: Integrate with browser's own notifications or scripts, listening for AUTO_REFRESH_UPDATE for secondary development of reminders.

Common Issues

IssueSolution
Scheduled refresh not triggeredThe browser might be hibernated by the system. Reopen the extension or manually click "Refresh Now"; if necessary, try reducing the interval.
Frequent Cloudflare rate limitingAppropriately increase the refresh interval and ensure that Cloudflare Bypass Helper can perform pop-up verification normally.
Refresh failed with 401/403 errorThe login status has expired. Revisit the corresponding site in the browser and refresh the plugin.
Multi-device conflictsIt is recommended to use WebDAV Backup and Auto Sync to unify account data and avoid repeatedly refreshing the same site.

Related Documentation

  • Cloudflare Bypass Helper
  • Auto Check-in
  • WebDAV Backup and Auto Sync
  • Permission Management (Optional Permissions)
Last Updated: 1/26/26, 5:14 PM
Contributors: github-actions[bot], qixing-jk, anime