Files
at-mintel/packages/next-utils
Marc Mintel 5f7a254fcb
Some checks failed
Monorepo Pipeline / ⚡ Prioritize Release (push) Successful in 6s
Monorepo Pipeline / 🏗️ Build (push) Failing after 2m56s
Monorepo Pipeline / 🧪 Test (push) Successful in 4m2s
Monorepo Pipeline / 🧹 Lint (push) Failing after 4m37s
Monorepo Pipeline / 🚀 Release (push) Has been skipped
Monorepo Pipeline / 🐳 Build Image Processor (push) Has been skipped
Monorepo Pipeline / 🐳 Build Directus (Base) (push) Has been skipped
Monorepo Pipeline / 🐳 Build Gatekeeper (Product) (push) Has been skipped
Monorepo Pipeline / 🐳 Build Build-Base (push) Has been skipped
Monorepo Pipeline / 🐳 Build Production Runtime (push) Has been skipped
chore: sync versions to v1.8.11
2026-02-22 21:59:19 +01:00
..
2026-02-22 21:59:19 +01:00
2026-02-01 01:01:16 +01:00
2026-01-31 19:26:46 +01:00

@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
}