Skip to content

Quick start

Terminal window
npm install fatigue-kit
import { createFatigue } from 'fatigue-kit'
import { localStorageAdapter } from 'fatigue-kit/adapters/local-storage'
const fatigue = createFatigue({ storage: localStorageAdapter() })
const result = fatigue.tryConsume('onboarding-guide', [
{ max: 1, every: 'day' },
{ cooldown: '4h' },
])
if (result.allowed) showOnboardingGuide()

Use peek for a read-only check. Use reset, exportRecord and importRecord for operations and debugging.