Skip to content

Latest commit

 

History

History

nextjs-app-dir-rate-limit

Arcjet Logo

Arcjet Rate Limit with Next.js using the App Router

This example shows how to use Arcjet with a Next.js route handler.

How to use

  1. From the root of the project, install the SDK dependencies.

    npm ci
  2. Enter this directory and install the example's dependencies.

    cd examples/nextjs-app-dir-rate-limit
    npm ci
  3. Rename .env.local.example to .env.local and add your Arcjet key.

  4. Start the dev server.

    npm run dev
  5. Visit http://localhost:3000/api/arcjet.

  6. Refresh the page to trigger the rate limit.