Automatic refresh keeps a private GitHub library current without manual refreshes. Context7 refreshes it on a schedule, or soon after each push to the branch it tracks. A refresh runs, and is billed, only when the branch has new commits that change the documentation.
Automatic refresh is available to teamspaces on the Pro and Enterprise plans, for private repositories on github.com. It is off by default for every library. GitLab, Bitbucket, other Git providers and GitHub Enterprise Server are not supported; refresh those manually.
Before you start#
- The library must be one of your teamspace’s private sources, added from GitHub.
- You must be an owner or admin of the teamspace.
- The Context7 GitHub App must be installed on the repository, through an installation your GitHub account can use, and your GitHub account must be able to read the repository. Context7 checks both when you turn a mode on. Refreshes then use the App’s access, not your account’s.
Turn on automatic refresh#
Open the Sources tab
Go to your teamspace’s Sources tab. The Connected Sources table has an Auto refresh column on Pro and Enterprise. On Free it also shows while a library still has a mode from a paid plan, so you can turn it off. Sources that are not private GitHub repositories show ”-” there.
Choose a mode for a library
Pick a mode in the library’s Auto refresh menu. Hover the menu to see the library’s last automatic refresh.
- Off: refreshed only when you refresh it.
- Weekly, Daily or Hourly: refreshed on that schedule when the branch has new commits.
- On every push: refreshed a few minutes after a push to the tracked branch.
Confirm the cost
Context7 shows the price, the typical cost of one refresh of this library and the most the mode could cost in a month. Select Turn on to save.
You can change the mode or turn it off at any time. Turning a mode off never needs GitHub access. On Pro, the line under the table shows how many of your 10 libraries have automatic refresh on.
The Auto refresh column is hidden on narrow screens such as phones. Open the dashboard on a wider screen to change a mode.
Plan limits#
| Pro | Enterprise | |
|---|---|---|
| Shortest time between automatic refreshes of a library | 3 hours | 30 minutes |
| Automatic refreshes per library per day | 6 | 48 |
| Libraries with automatic refresh on | 10 per teamspace | No limit |
Both limits apply. On Pro, Hourly runs at most every 3 hours and stops for the day after 6 refreshes, so it never reaches the 8 that the 3-hour interval alone would allow. Pushes that arrive inside the 3-hour window are combined into one refresh at its end, and a burst of pushes always makes a single refresh.
If a teamspace moves from Enterprise to Pro, its first 10 libraries keep refreshing, in the order their automatic refresh was turned on. A warning icon in the Auto refresh column marks the others as not running on the current plan; turn some off or upgrade. On the Free plan no automatic refresh runs, and a library that kept a mode from a paid plan can only be turned Off.
What a refresh costs#
Automatic refreshes are billed like manual ones: their parse tokens are charged to the teamspace at $5 per 1M tokens. See Plans & Pricing.
Most automatic refreshes cost much less than the first parse:
- A scheduled check whose branch has no new commit starts no refresh and costs nothing.
- A new commit that changes no documentation is skipped.
- On a refresh, unchanged pages come from the cache, so only changed pages are billed.
When you turn a mode on, the estimate uses this library’s recent refreshes. With no history, it uses the typical cost of a private refresh. The monthly figure is an upper bound: it assumes every scheduled run, or every push, found documentation changes.
When a refresh pauses#
A paused library shows an amber play icon in the Auto refresh column. Hover it to see why it paused:
- The GitHub App no longer reaches the repository. The App was uninstalled or lost access to the repository. Give the App access to the repository again, then select the play icon to resume.
- Repeated failures. After a failed refresh Context7 tries again after 15 minutes, 1 hour and 6 hours, then pauses. Fix the cause (for example a branch that no longer exists), then select the play icon to resume.
Shared libraries#
A library several teamspaces track is refreshed once for all of them. Each teamspace still sees its own mode. A scheduled refresh is billed to the teamspace whose schedule was due, so a weekly teamspace never pays for another teamspace’s hourly refreshes.
Use the API#
Read or set a library’s mode with the management API: Get automatic refresh and Set automatic refresh (PUT with { "mode": "off" | "weekly" | "daily" | "hourly" | "push" }). Setting a mode needs an API key with Write access.
Related#
- Add Private Sources
- GitOps, to set the mode from a manifest file
- Keeping Libraries Fresh, for public libraries
- Automatic Repository Updates, for on-premise installations