Skip to content

@pumpkin-plugins/update-check ​

npm downloadslatest npm releasenpm license

Checks a plugin's current version against Pumpkin Market over Pumpkin's WASI HTTP host. The registration helper starts a non-blocking request after plugin loading when given a scheduler.

ts
import { registerPluginWithUpdates } from '@pumpkin-plugins/update-check';

registerPluginWithUpdates(plugin, info, { schedule });

The plugin must request the http WASI capability and the server must grant http.outbound. The scheduler defers the initial request and dispatches follow-up polls through the plugin's task handler. The scheduler must run callbacks in a later task, never inline. Automatic checks do not block plugin startup or server ticks.

Asynchronous requests time out after 15 seconds. Response bodies larger than 64 KiB are rejected.

A failed update request is logged and does not interrupt plugin loading. checkMarketUpdate remains available for direct checks with an injected synchronous JSON request function, which is useful for deterministic tests. The request registration option takes the same kind of function in place of the scheduled request. It runs synchronously inside onLoad and blocks plugin loading, so use it only in tests. requestMarketJsonAsync exposes the same non-blocking transport for direct use. The synchronous requestMarketJson transport blocks and must not be called during plugin loading or server ticks. marketplaceUrl overrides the Market base URL for registration and direct version checks.

When Market returns optional release_notes, the checker converts its Markdown to plain text for the update notice. The current Market check endpoint does not return this field; a Market API update must add it before plugins can show changelogs.

For the server capability and registration setup, see the plugin updates guide.

See the tool guide and API reference on the documentation site.

pumpkin-plugins documentation