Repository navigation
Major Changes
-
#637
d65fda6Thanks @wKovacs64! - Drop support for Node.js 20, which is end-of-life. The minimum Node.js version is now 22.12.0, the first Node.js 22 release that canrequire()ESM without a flag. Upgrade Node.js, or keep using hibp 15.x if you can't. -
#625
c55048eThanks @wKovacs64! - CorrectbreachedAccount()andsearch().breachestypes to reflect truncation. Default andtruncate: truesearches expose onlyName;truncate: falseexposes fullBreachobjects. Dynamic boolean options allow either result shape. Both preservenull.TypeScript consumers accessing full-only fields such as
TitleorDataClassesmust passtruncate: falseor narrow dynamic results. Runtime requests and responses are unchanged. -
#624
8517b19Thanks @wKovacs64! - CorrectPaste.Titleto an optional string andPaste.Datetostring | null, matching the haveibeenpwned.com paste model.TypeScript consumers of
Paste,pasteAccount(), andsearch()must handle absent titles and null dates before using them as strings. This can introduce compile errors with strict null checks; HTTP response handling is unchanged.
Minor Changes
-
#619
9bf2740Thanks @wKovacs64! - AdddataClassDescriptionsand theDataClassDescriptiontype with lowercasenameanddescriptionfields matching haveibeenpwned.com's live response. -
#626
d47a032Thanks @wKovacs64! - AddsendEmailand theEmailAliastype for domain verification approval emails. -
#620
87f02b6Thanks @wKovacs64! - AddbreachedAccountRangefor six-character SHA-1 email hash prefixes, returninghashSuffixandwebsitesresults. Requires a Pro or High RPM subscription; callers must discard unrelated results per haveibeenpwned.com's terms of use. -
#623
a451599Thanks @wKovacs64! - AddgenerateDnsTokenandverifyDnsTokenfor domain verification through DNS. -
#618
1df8169Thanks @wKovacs64! - Add theisSpamListoption tobreaches():trueselects spam-list breaches,falseselects non-spam-list breaches, and omission applies no spam-list filter. Can be combined withdomain.
Patch Changes
-
#621
cc059b1Thanks @wKovacs64! - Complete the exportedBreachtype with requiredIsStealerLog: boolean,
Attribution: string | null, andDisclosureUrl: string | nullfields, matching
haveibeenpwned.com's live responses.TypeScript consumers constructing
Breachobjects, including mocks and fixtures,
must supply these fields. Handle null when reading attribution or disclosure URLs.
The SDK continues returning the upstream response without transforming it. -
#622
70c08fbThanks @wKovacs64! - CompleteSubscriptionStatuswith the documented haveibeenpwned.com fields:MaxBreachedDomains(number | null),IncludesBulkDomainAdd,IncludesAutoSubdomainVerification,IncludesCustomerDomains, andIncludesKAnon(boolean). These fields are required, so TypeScript consumers constructing subscription status objects, including mocks and fixtures, must supply them. Anulldomain limit means unlimited domains. Runtime response handling is unchanged. -
#636
99e437bThanks @wKovacs64! - Send the defaulthibp <version>User-Agent in every non-browser runtime. The SDK skipped it whenever a globalnavigatorexisted, which Node.js 21+, Bun, Deno, and Cloudflare Workers all define. Those requests went out with the runtime's User-Agent (e.g.node), or none at all on Cloudflare Workers. Browser pages and workers still send their own User-Agent, because setting one triggers a CORS preflight that haveibeenpwned.com rejects. -
#635
f165d82Thanks @wKovacs64! - Document which HIBP plans (Core, Pro, High RPM) include each key-requiring function. -
#633
5b645a5Thanks @wKovacs64! - GET operations reject a 401 with the JSON body'smessageaserror.message(e.g.Access denied due to missing hibp-api-key.) instead of the raw JSON body, matching domain verification POST operations. Plain-text 401 bodies are still used as-is, and an empty 401 body rejects with the HTTP status (e.g.401 Unauthorized). A 429 without a JSON body now rejects withRateLimitErrorcarrying the HTTP status as its message, instead ofSyntaxError.