@@ -57,6 +57,9 @@ convenience method is designed to mimic.</p>
5757required, but direct requests made without it (that is, without specifying a
5858<code >baseUrl</code > to a proxy that inserts a valid API key on your behalf) will fail.</p >
5959</dd >
60+ <dt ><a href =" #subscriptionStatus " >subscriptionStatus(apiKey, [options])</a > ⇒ <code ><a href =" #subscriptionstatus--object " >Promise.< ; SubscriptionStatus> ; </a ></code ></dt >
61+ <dd ><p >Fetches the current status of your HIBP subscription (API key).</p >
62+ </dd >
6063</dl >
6164
6265## Typedefs
@@ -75,6 +78,9 @@ hash prefix) to how many times it occurred in the Pwned Passwords repository.</p
7578<dt ><a href =" #SearchResults " >SearchResults</a > : <code >object</code ></dt >
7679<dd ><p >An object representing search results.</p >
7780</dd >
81+ <dt ><a href =" #subscriptionstatus--object " >SubscriptionStatus</a > : <code >object</code ></dt >
82+ <dd ><p >An object representing the status of your HIBP subscription.</p >
83+ </dd >
7884</dl >
7985
8086<a name =" breach " ></a >
@@ -444,6 +450,31 @@ try {
444450 // ...
445451}
446452```
453+ <a name =" subscriptionStatus " ></a >
454+
455+ ## subscriptionStatus(apiKey, [ options] ) ⇒ [ <code >Promise.< ; SubscriptionStatus> ; </code >] ( #subscriptionstatus--object )
456+ Fetches the current status of your HIBP subscription (API key).
457+
458+ ** Kind** : global function
459+ ** Returns** : [ <code >Promise.< ; SubscriptionStatus> ; </code >] ( #subscriptionstatus--object ) - a Promise which resolves to a
460+ subscription status object, or rejects with an Error
461+
462+ | Param | Type | Description |
463+ | --- | --- | --- |
464+ | apiKey | <code >string</code > | an API key from https://haveibeenpwned.com/API/Key |
465+ | [ options] | <code >object</code > | a configuration object |
466+ | [ options.baseUrl] | <code >string</code > | a custom base URL for the haveibeenpwned.com API endpoints (default: ` https://haveibeenpwned.com/api/v3 ` ) |
467+ | [ options.userAgent] | <code >string</code > | a custom string to send as the User-Agent field in the request headers (default: ` hibp <version> ` ) |
468+
469+ ** Example**
470+ ``` js
471+ try {
472+ const data = await subscriptionStatus (" my-api-key" );
473+ // ...
474+ } catch (err) {
475+ // ...
476+ }
477+ ```
447478<a name =" Breach " ></a >
448479
449480## Breach : <code >object</code >
@@ -508,3 +539,19 @@ An object representing search results.
508539| breaches | [ <code >Array.< ; Breach> ; </code >] ( #breach--object ) \| <code >null</code > |
509540| pastes | [ <code >Array.< ; Paste> ; </code >] ( #Paste ) \| <code >null</code > |
510541
542+ <a name =" SubscriptionStatus " ></a >
543+
544+ ## SubscriptionStatus : <code >object</code >
545+ An object representing the status of your HIBP subscription.
546+
547+ ** Kind** : global typedef
548+ ** Properties**
549+
550+ | Name | Type |
551+ | --- | --- |
552+ | SubscriptionName | <code >string</code > |
553+ | Description | <code >string</code > |
554+ | SubscribedUntil | <code >string</code > |
555+ | Rpm | <code >number</code > |
556+ | DomainSearchMaxBreachedAccounts | <code >number</code > |
557+
0 commit comments