Hi there! Are you looking for the official Deno documentation? Try docs.deno.com for all your Deno learning needs.

rateLimitPolicy

import { rateLimitPolicy } from "https://gitlab.com/soapbox-pub/strfry-policies/-/raw/develop/mod.ts";

Rate-limits users by their IP address.

IPs are stored in an SQLite database. If you are running internal services, it's a good idea to at least whitelist 127.0.0.1 etc.

@example
// Limit to 10 events per second.
rateLimitPolicy(msg, { max: 10, interval: 60000 });
const rateLimitPolicy: Policy<RateLimit>;