Arcjet helps developers protect their apps in just a few lines of
code. Implement rate limiting, bot protection, email verification & defend
against common attacks.
import arcjet from"@arcjet/next";
import { NextResponse } from"next/server";
const aj = arcjet({
// Get your site key from https://app.arcjet.com// and set it as an environment variable rather than hard coding.// See: https://nextjs.org/docs/app/building-your-application/configuring/environment-variableskey: process.env.ARCJET_KEY,
rules: [],
});
exportasyncfunctionGET(req: Request) {
const decision = await aj.protect(req);
if (decision.isDenied()) {
returnNextResponse.json(
{ error: "Too Many Requests", reason: decision.reason },
{ status: 429 },
);
}
returnNextResponse.json({ message: "Hello world" });
}
We found that @arcjet/next demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago.It has 2 open source maintainers collaborating on the project.
Package last updated on 09 Feb 2024
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Ransomware payment rates hit an all-time low in 2024 as law enforcement crackdowns, stronger defenses, and shifting policies make attacks riskier and less profitable.