dependabit / plugins/plugin-context7/src / Context7Checker
Class: Context7Checker
Defined in: packages/plugins/plugin-context7/src/checker.ts:131
Monitors library documentation changes via the Context7 API, with a fallback to direct URL content hashing when the API is unavailable.
Remarks
The checker first tries https://api.context7.io/v1/libraries/:id. On 404 or 503 it silently falls back to fetching the documentation URL directly and hashing the full response body.
Version severity is determined via semver.diff — major semver bumps are classified as breaking, minor as major, patch/pre-release as minor. Non-semver versions (e.g. unknown) default to minor.
Use When
Tracking libraries whose documentation is indexed by Context7 (e.g., React, Next.js, Prisma).
Avoid When
Monitoring libraries without a Context7 entry — the fallback URL hash is very sensitive to dynamic page content. Prefer a specific HTTP checker with normalised content in that case.
Pitfalls
- Fallback URL hash instability: when the API is unavailable and the checker falls back to direct URL hashing, any dynamic content on the documentation page (e.g., timestamps, ads, CDN-injected nonces) will produce false positive changes.
- Zod schema mismatches: if Context7 changes its API response shape,
Context7ResponseSchema.parsewill throw aZodErrorand the checker silently falls back to URL hashing without logging the schema error. lastUpdatedchange without version bump: some Context7 libraries update theirlastUpdatedfield without bumping the version number. This produces achanges: ['lastUpdated']result withseverity: 'minor'.
Constructors
Constructor
new Context7Checker(): Context7Checker;Returns
Context7Checker
Methods
compare()
compare(prev, curr): Promise<Context7ChangeDetection>;Defined in: packages/plugins/plugin-context7/src/checker.ts:266
Compare two Context7 snapshots to detect changes
Parameters
| Parameter | Type |
|---|---|
prev | Context7Snapshot |
curr | Context7Snapshot |
Returns
Promise<Context7ChangeDetection>
fetch()
fetch(config): Promise<Context7Snapshot>;Defined in: packages/plugins/plugin-context7/src/checker.ts:159
Fetch library information from Context7 API
Parameters
| Parameter | Type |
|---|---|
config | Context7Config |
Returns
Promise<Context7Snapshot>