Skip to content

Arcjet / Better Auth integration

Arcjet can protect your Better Auth routes from brute force attacks, signup spam and other abuse. You can also use the authenticated user ID to implement user-specific rate limits.

What is Arcjet? Arcjet is the runtime security platform that ships with your AI code. Enforce budgets, stop prompt injection, detect bots, and protect personal information with Arcjet's AI security building blocks.

See an example Next.js + Better Auth implementation on GitHub.

We recommend integrating Arcjet in the auth route handler rather than a Better Auth Hook because hooks do not provide sufficient request context in server-only environments.

Discussion