- Notifications
You must be signed in to change notification settings - Fork5
An example Next.js application protected by Arcjet.
License
arcjet/example-nextjs
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
Arcjet helps developers protect their apps in just a fewlines of code. Bot detection. Rate limiting. Email validation. Attackprotection. Data redaction. A developer-first approach to security.
This is an example Next.js application demonstrating the use of multiplefeatures. It is deployed athttps://example.arcjet.com.
- Signup form protection uses Arcjet'sserver-side email verification configured to block disposable providers andensure that the domain has a valid MX record. It also includes rate limitingand bot protection to prevent automated abuse.
- Bot protection shows how a page can beprotected from automated clients.
- Rate limiting shows the use ofdifferent rate limit configurations depending on the authenticated user. Alogged-in user can make more requests than an anonymous user.
- Attack protection demonstrates ArcjetShield, which detects suspicious behavior, such as SQL injection andcross-site scripting attacks.
- Sensitive info protects againstclients sending you sensitive information such as PII that you do not wish tohandle.
Install dependencies:
npm ci
Rename
.env.local.example
to.env.local
and add your Arcjet key. If youwant to test the rate limiting authentication, you will also need to add anAuth.js secret andcreate a GitHub OAuthapp.Start the dev server
npm run dev
- Openhttp://localhost:3000 in your browser.
Check outthe docs,contactsupport, orjoin our Discordserver.
- Auth:Auth.js
- App:Next.js
- Form handling:React Hook Form (see alsoourfull form protectionexample)
- Client-side validation:Zod
- Security:Arcjet
About
An example Next.js application protected by Arcjet.
Topics
Resources
License
Security policy
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Uh oh!
There was an error while loading.Please reload this page.
Contributors8
Uh oh!
There was an error while loading.Please reload this page.