init
This commit is contained in:
28
packages/next-utils/README.md
Normal file
28
packages/next-utils/README.md
Normal file
@@ -0,0 +1,28 @@
|
||||
# @mintel/next-utils
|
||||
|
||||
Reusable utilities for Mintel Next.js projects.
|
||||
|
||||
## Features
|
||||
|
||||
- **i18n**: Standardized middleware and request configuration for `next-intl`.
|
||||
- **Env Validation**: Zod-based environment variable validation.
|
||||
- **Rate Limiting**: Simple in-memory rate limiting for server actions.
|
||||
|
||||
## Usage
|
||||
|
||||
### i18n Middleware
|
||||
```typescript
|
||||
import { createMintelMiddleware } from "@mintel/next-utils";
|
||||
|
||||
export default createMintelMiddleware({
|
||||
locales: ["en", "de"],
|
||||
defaultLocale: "en",
|
||||
});
|
||||
```
|
||||
|
||||
### Env Validation
|
||||
```typescript
|
||||
import { validateMintelEnv } from "@mintel/next-utils";
|
||||
|
||||
const env = validateMintelEnv();
|
||||
```
|
||||
Reference in New Issue
Block a user