@vercel/firewall
v0.1.4
Published
[Experimental] Programming rate limits powered by the Vercel Firewall
Downloads
641
Keywords
Readme
@vercel/firewall
Programmatic rate limits
See our Firewall docs for detailed documentation of @vercel/firewall.
import { unstable_checkRateLimit as checkRateLimit } from '@vercel/firewall';
export async function POST() {
const { rateLimited } = await checkRateLimit('my-rate-limit-id');
if (rateLimited) {
return new Response('', {
status: 429,
});
}
// Implement logic guarded by rate limit
}