29 lines
631 B
Markdown
29 lines
631 B
Markdown
# @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();
|
|
```
|