Nag
Nag helper returned by Sponsorkit.nag().
Nag helper returned by Sponsorkit.nag().
import type { Nag } from "@sponsorkit/sdk";
interface Nag { … }Interface, exported from @sponsorkit/sdk, @sponsorkit/sdk/node.
Methods#
due()#
due(predicate?: NagPredicate, options?: NagDueOptions): Promise<boolean>Counts this run (once per process) and returns whether to show the nag:
predicate(fc) && (runs >= every || since(lastShown) >= orEvery).
Always false when disabled, in CI, with SPONSORKIT_NO_NAG, or without a TTY, unless force.
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
predicate | NagPredicate | optional | See NagPredicate. |
options | NagDueOptions | optional | See NagDueOptions. |
Returns Promise<boolean>
shown()#
shown(): Promise<void>Records that the nag was shown: resets the run counter and lastShown.
Returns Promise<void>