Arcjet helps developers protect their apps in just a few lines of code. Bot detection. Rate limiting. Email validation. Attack protection. Data redaction. A developer-first approach to security.
This is an example Next.js application demonstrating how to protect a Next.js form which uses an API route. It also uses Arcjet Nosecone to configure security headers in middleware.
- Bot protection shows how the form can be protected from automated clients.
- Rate limiting shows a rate limit configuration that limits the number of requests from a single IP.
- Attack protection demonstrates Arcjet Shield, which detects suspicious behavior, such as SQL injection and cross-site scripting attacks.
-
Install dependencies:
npm ci
-
Rename
.env.local.example
to.env.local
and add your Arcjet key. -
Start the dev server
npm run dev
- Open http://localhost:3000 in your browser.
Check out the docs, contact support, or join our Discord server.