Skip to content

Latest commit

 

History

History

nextjs-app-dir-validate-email

Arcjet Logo

Arcjet email verification 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-validate-email
    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 see the email verification fail due to no MX records existing on the domain.