Back to Templates

Ratelimit your Next.js routes

Using @thinkroman/ratelimit to protect your API routes from abuse

Written by
chronark
Framework
Next.js
Language
Typescript
Using @thinkroman/ratelimit to protect your API routes from abuse

This is a Next.js project bootstrapped with create-next-app.

Getting Started

Go to unkey.dev and create a new root key. The onboarding flow will create one for you. Take the root key and create a .env.local file in the root of the project. Add the following line to the file:

1UNKEY_ROOT_KEY=your_root_key_here

Then, run the development server:

1npm run dev
2# or
3yarn dev
4# or
5pnpm dev
6# or
7bun dev

Open http://localhost:3000/simple with your browser to see the result.

Elevate your career with ThinkRoman USA

Stay ahead, stay informed, and stay connected with ThinkRoman USA!