Allowed

Run the real engine.

Compose every v1 rule, move time, and share a reproducible state.

This demo uses memory and simulated time. The generated Web code uses localStorage and your device clock.

Rules
[
  {
    "max": 1,
    "every": "day",
    "cutoff": "00:00",
    "weekStartsOn": 1
  },
  {
    "max": 3,
    "window": "7d"
  },
  {
    "cooldown": "4h"
  }
]
Remaining
1
Simulated time
2026-10-22T08:00:00.000Z

Generated TypeScript

npm install fatigue-kit
import { createFatigue } from 'fatigue-kit'
import { localStorageAdapter } from 'fatigue-kit/adapters/local-storage'

// Browser entry only. Records survive reloads; rules use device local time.
const fatigue = createFatigue({ storage: localStorageAdapter() })
const result = fatigue.tryConsume("coupon-popup", [
  {
    "max": 1,
    "every": "day",
    "cutoff": "00:00",
    "weekStartsOn": 1
  },
  {
    "max": 3,
    "window": "7d"
  },
  {
    "cooldown": "4h"
  }
])

if (result.allowed) {
  // Display your existing popup here.
}

Rules run locally; share URLs contain the key and record. If site analytics is configured, it sends filtered page views and explicit demo/copy/link actions, never your key or record.