@clan-europe/osrs-drops-sdk
v0.5.0
Published
Pre-generated SDK of OSRS boss/raid EHB rates and notable drop items with their probabilities, scraped from the Wise Old Man API and OSRS Wiki — so consumers never scrape live.
Readme
@clan-europe/osrs-drops-sdk
Pre-generated SDK of OSRS boss/raid EHB rates and notable drop items with their probabilities. The data is scraped from the Wise Old Man API and the OSRS Wiki once, periodically — consumers of this package never scrape live.
Usage
import { getSources, getSourceDrops } from '@clan-europe/osrs-drops-sdk';
const sources = getSources(); // EhbSource[] — every boss/raid EHB rate
const drops = getSourceDrops('vorkath'); // SourceDrops | undefinedSee src/types.ts for the full shape of EhbSource, DropItem, and
SourceDrops.
Regenerating the data
pnpm generate # scrapes WOM + the wiki, overwrites src/data/generated.json
pnpm build # bundles src/index.ts (+ the freshly generated data) into dist/pnpm generate hits the network (Wise Old Man + the OSRS Wiki) and takes a
couple of minutes for the full set of ~70 sources. Unlike most generated
files, src/data/generated.json is committed to the repo — see
"Generating & publishing" below for how and when that happens in CI. If
you're just testing locally, feel free to regenerate freely; only commit the
result yourself if you specifically mean to trigger a data-refresh release.
An optional WOM_API_KEY environment variable raises Wise Old Man rate
limits; the generator works fine without it.
Generating & publishing
Two separate workflows:
.github/workflows/osrs-drops-sdk-generate.yml— runsgenerateevery Wednesday at 12:00 UTC (or via manual dispatch). If the result is meaningfully different from what's committed (ignoring thegeneratedAttimestamp, which always changes), it commitssrc/data/generated.jsonwithfeat(osrs-drops-sdk): refresh generated drop dataand pushes. No meaningful change -> no commit, no downstream publish..github/workflows/osrs-drops-sdk.yml— triggered by any push under this folder (including the generate workflow's commit above) or manual dispatch. Derives the next version from Conventional Commits touching this path since the lastvX.Y.Z-osrs-drops-sdktag:feat:bumps minor (this is why the data-refresh commit uses that prefix), a!suffix orBREAKING CHANGEfooter bumps major, anything else (fix:,chore:, ...) bumps patch. No relevant commits since the last tag -> nothing to publish. Otherwise it builds whatever is currently committed and runspnpm publishto the public npm registry (@clan-europescope), then commits the bumpedpackage.jsonback to the repo (chore(osrs-drops-sdk): release vX.Y.Z [skip ci]) and tags itvX.Y.Z-osrs-drops-sdk.
Consuming inside this monorepo
apps/website depends on this package via workspace:*, so it always uses
whatever is currently built in dist/ here. src/data/generated.json is
committed with real data (refreshed weekly by the generate workflow above),
so a plain pnpm build already produces a real package. To force a fresh
scrape locally instead:
pnpm --filter @clan-europe/osrs-drops-sdk generate
pnpm --filter @clan-europe/osrs-drops-sdk build