@@ -15,24 +15,20 @@ A powerful, type-safe middleware system for Next.js with plugin architecture, ro
1515
1616``` bash
1717# using pnpm
18- pnpm add @chaqchase/next- middleware
18+ pnpm add middleware-toolkit
1919# using npm
20- npm install @chaqchase/next- middleware
20+ npm install middleware-toolkit
2121# using bun
22- bun add @chaqchase/next- middleware
22+ bun add middleware-toolkit
2323# using yarn
24- yarn add @chaqchase/next- middleware
24+ yarn add middleware-toolkit
2525```
2626
2727## Quick Start
2828
2929``` typescript
3030// middleware.ts
31- import {
32- MiddlewareBuilder ,
33- LoggingPlugin ,
34- Rules ,
35- } from ' @chaqchase/next-middleware' ;
31+ import { MiddlewareBuilder , LoggingPlugin , Rules } from ' middleware-toolkit' ;
3632
3733type User = {
3834 id: string ;
@@ -66,7 +62,7 @@ export const config = {
6662## Built-in Rules
6763
6864``` typescript
69- import { Rules , Responses } from ' @chaqchase/next- middleware' ;
65+ import { Rules , Responses } from ' middleware-toolkit ' ;
7066
7167// Authentication
7268Rules .isLoggedIn ();
@@ -127,7 +123,7 @@ Rules.custom(({ data, params }) => {
127123### Logging Plugin
128124
129125``` typescript
130- import { LoggingPlugin } from ' @chaqchase/next- middleware' ;
126+ import { LoggingPlugin } from ' middleware-toolkit ' ;
131127
132128new LoggingPlugin ({
133129 enabled: true ,
@@ -140,7 +136,7 @@ new LoggingPlugin({
140136### Caching Plugin
141137
142138``` typescript
143- import { CachingPlugin , MemoryCacheStorage } from ' @chaqchase/next- middleware' ;
139+ import { CachingPlugin , MemoryCacheStorage } from ' middleware-toolkit ' ;
144140
145141new CachingPlugin ({
146142 enabled: true ,
@@ -157,7 +153,7 @@ import {
157153 Plugin ,
158154 MiddlewareContext ,
159155 MiddlewareResult ,
160- } from ' @chaqchase/next- middleware' ;
156+ } from ' middleware-toolkit ' ;
161157
162158class AnalyticsPlugin implements Plugin {
163159 name = ' analytics' ;
@@ -181,7 +177,7 @@ class AnalyticsPlugin implements Plugin {
181177## Response Helpers
182178
183179``` typescript
184- import { Responses } from ' @chaqchase/next- middleware' ;
180+ import { Responses } from ' middleware-toolkit ' ;
185181
186182Responses .next ();
187183Responses .redirect (' /login' );
@@ -194,7 +190,7 @@ Responses.notFound('Page not found');
194190## Internationalization
195191
196192``` typescript
197- import { I18nPlugin } from ' @chaqchase/next- middleware' ;
193+ import { I18nPlugin } from ' middleware-toolkit ' ;
198194
199195const middleware = new MiddlewareBuilder ({
200196 fetchUser ,
@@ -245,7 +241,7 @@ Rules.custom(({ metadata }) => {
245241## Redis Caching Example
246242
247243``` typescript
248- import { CacheStorage } from ' @chaqchase/next- middleware' ;
244+ import { CacheStorage } from ' middleware-toolkit ' ;
249245import Redis from ' ioredis' ;
250246
251247class RedisCacheStorage implements CacheStorage {
@@ -284,7 +280,7 @@ new CachingPlugin({
284280## Legacy API Support
285281
286282``` typitten
287- import Middleware from '@chaqchase/next- middleware';
283+ import Middleware from 'middleware-toolkit ';
288284
289285const middleware = new Middleware({
290286 fetch: fetchUser,
0 commit comments