Standalone fixed-window rate-limit check (Unkey-style): returns the decision, you decide how to react. Member-gated, bearer required.
import { GatekeeperCore, RateLimitService } from '@orkait/sdk';
const rateLimit = new RateLimitService(core);Methods#
| Method | Returns | Notes |
|---|---|---|
check(tenantId, identifier, limit, windowSeconds) | RateLimitResult | { success, limit, remaining, reset } |
identifier is your own bucket key (user id, IP, route). reset is epoch ms.
Example#
const r = await rateLimit.check('t1', 'user:42', 100, 60);
if (!r.success) {
// over limit; r.reset = when the window resets
}