• Joined on 2026-01-15

@mintel/next-utils (1.9.7)

Published 2026-03-02 20:23:32 +00:00 by mmintel in mmintel/at-mintel

Installation

@mintel:registry=
npm install @mintel/next-utils@1.9.7
"@mintel/next-utils": "1.9.7"

About this package

@mintel/next-utils

A collection of reusable utilities and helpers for Mintel Next.js projects, focusing on internationalization, environment safety, and security.

Features

🌍 Internationalization (i18n)

Standardized helpers for next-intl:

  • createMintelMiddleware: A logging-enabled middleware wrapper.
  • createMintelI18nRequestConfig: Centralized request configuration for server-side translations.

🔐 Environment Validation

Zod-based validation to ensure your app never boots with missing secrets:

  • validateMintelEnv: Validates standard Mintel variables (Mail, Sentry, Umami).

🛡 Rate Limiting

  • rateLimit: A simple in-memory rate limiter for protecting server actions and form submissions.

🚀 Usage

i18n Middleware (src/middleware.ts)

import { createMintelMiddleware } from "@mintel/next-utils";

export default createMintelMiddleware({
  locales: ["en", "de"],
  defaultLocale: "en",
  logRequests: true,
});

Env Validation (scripts/validate-env.ts)

import { validateMintelEnv } from "@mintel/next-utils";

validateMintelEnv();

Rate Limiting

import { rateLimit } from "@mintel/next-utils";

export async function myAction(data: any) {
  await rateLimit(data.email);
  // ... logic
}

Dependencies

Dependencies

ID Version
next 16.1.6
next-intl ^4.8.2
zod ^3.0.0

Development Dependencies

ID Version
@mintel/eslint-config 1.9.7
@mintel/tsconfig 1.9.7
eslint ^9.39.2
tsup ^8.0.0
typescript ^5.0.0
Details
npm
2026-03-02 20:23:32 +00:00
6
4.7 KiB
Assets (1)
Versions (11) View all
1.9.11 2026-03-03
1.9.10 2026-03-03
1.9.8 2026-03-03
1.9.7 2026-03-02
1.9.5 2026-02-27